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
1ab9c9fc
Commit
1ab9c9fc
authored
Mar 03, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev_zxm
parents
32e6b8e4
cd66fe60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
255 additions
and
44 deletions
+255
-44
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyFollowController.java
+5
-7
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
+2
-1
yd-csf-feign/src/main/java/com/yd/csf/feign/request/appointment/ApiAppointmentAddStorageRequest.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyDto.java
+17
-1
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyFollowDto.java
+4
-1
yd-csf-service/src/main/java/com/yd/csf/service/model/Policy.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/model/PolicyFollow.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyFollowService.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
+156
-9
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
+53
-21
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
+0
-2
yd-csf-service/src/main/resources/mappers/PolicyMapper.xml
+2
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyFollowController.java
View file @
1ab9c9fc
...
...
@@ -492,7 +492,6 @@ public class ApiPolicyFollowController {
*/
@PostMapping
(
"/change_status"
)
@Operation
(
summary
=
"修改跟进状态"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Boolean
>
changePolicyFollowStatus
(
@RequestBody
ChangePolicyFollowStatusRequest
changePolicyFollowStatusRequest
,
HttpServletRequest
request
)
{
if
(
changePolicyFollowStatusRequest
==
null
||
StringUtils
.
isBlank
(
changePolicyFollowStatusRequest
.
getPolicyBizId
()))
{
...
...
@@ -504,6 +503,9 @@ public class ApiPolicyFollowController {
if
(
policyFollow
==
null
)
{
return
Result
.
fail
(
ResultCode
.
NULL_ERROR
.
getCode
(),
ResultCode
.
NULL_ERROR
.
getMessage
());
}
if
(
ObjectUtils
.
isEmpty
(
policyFollow
.
getReconciliationCompanyCode
()))
{
return
Result
.
fail
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"新单跟进记录中,reconciliationCompanyCode不能为空"
);
}
PolicyFollowStatusEnum
currentStatusEnum
=
PolicyFollowStatusEnum
.
getEnumByValue
(
changePolicyFollowStatusRequest
.
getStatus
());
// 修改为生效时需要校验、同步预计发佣
...
...
@@ -712,15 +714,11 @@ public class ApiPolicyFollowController {
*/
@GetMapping
(
"/product_plan"
)
@Operation
(
summary
=
"查询产品计划信息"
)
public
Result
<
Policy
>
getProductPlan
(
@RequestParam
(
"policyBizId"
)
String
policyBizId
)
{
public
Result
<
Policy
Dto
>
getProductPlan
(
@RequestParam
(
"policyBizId"
)
String
policyBizId
)
{
if
(
StringUtils
.
isBlank
(
policyBizId
))
{
return
Result
.
fail
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"policyBizId不能为空"
);
}
Policy
policy
=
policyFollowService
.
getProductPlan
(
policyBizId
);
if
(
policy
==
null
)
{
return
Result
.
fail
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"产品计划信息不存在"
);
}
return
Result
.
success
(
policy
);
return
Result
.
success
(
policyFollowService
.
getProductPlan
(
policyBizId
));
}
/**
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
View file @
1ab9c9fc
...
...
@@ -364,7 +364,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
updateFnaBizIdAndNo
(
appointment
.
getFnaBizId
(),
appointment
.
getAppointmentBizId
(),
appointment
.
getAppointmentNo
());
//新增健康问卷和预约对象关系绑定
objectSaveJkQuestion
(
appointment
.
getAppointmentBizId
(),
request
.
getApiAnswerSaveRequest
());
//新增对象材料关系信息
addRelObjectMaterialList
(
appointment
.
getAppointmentBizId
(),
request
.
getMaterialDtoList
());
return
Result
.
success
();
}
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/appointment/ApiAppointmentAddStorageRequest.java
View file @
1ab9c9fc
...
...
@@ -44,6 +44,11 @@ public class ApiAppointmentAddStorageRequest {
private
ApiSecondHolderInfoDto
apiSecondHolderInfoDto
;
/**
* 附件信息
*/
private
List
<
ApiAppointmentMaterialDto
>
materialDtoList
;
/**
* 问卷-答题提交对象
*/
private
ApiAnswerSaveRequest
apiAnswerSaveRequest
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyDto.java
View file @
1ab9c9fc
package
com
.
yd
.
csf
.
service
.
dto
;
import
com.yd.csf.service.model.
PolicyAdditional
;
import
com.yd.csf.service.model.
*
;
import
com.yd.csf.service.vo.PolicyVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.apache.commons.lang3.ObjectUtils
;
import
java.io.Serializable
;
import
java.util.List
;
...
...
@@ -23,4 +24,19 @@ public class PolicyDto implements Serializable {
*/
@Schema
(
description
=
"保单附加险列表"
)
private
List
<
PolicyAdditional
>
apiProductPlanAdditionalInfoDtoList
;
public
static
PolicyDto
convertToDto
(
Policy
policy
,
List
<
PolicyAdditional
>
policyAdditionals
)
{
PolicyDto
dto
=
new
PolicyDto
();
if
(
ObjectUtils
.
isEmpty
(
policy
))
{
return
dto
;
}
// 产品计划主信息
dto
.
setApiProductPlanMainInfoDto
(
PolicyVO
.
objToVo
(
policy
));
// 附加险列表
dto
.
setApiProductPlanAdditionalInfoDtoList
(
policyAdditionals
);
return
dto
;
}
}
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyFollowDto.java
View file @
1ab9c9fc
...
...
@@ -150,7 +150,10 @@ public class PolicyFollowDto implements Serializable {
private
String
insuranceCompanyBizId
;
@Schema
(
description
=
"对账公司"
)
private
String
reconciliationCompany
;
private
String
reconciliationCompanyName
;
@Schema
(
description
=
"对账公司编码"
)
private
String
reconciliationCode
;
@Schema
(
description
=
"对账公司业务id"
)
private
String
reconciliationCompanyBizId
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/Policy.java
View file @
1ab9c9fc
...
...
@@ -83,6 +83,11 @@ public class Policy implements Serializable {
private
String
policyHolder
;
/**
* 保單持有人年齡
*/
private
Integer
policyHolderAge
;
/**
* 受保人
*/
private
String
insured
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/PolicyFollow.java
View file @
1ab9c9fc
...
...
@@ -241,6 +241,11 @@ public class PolicyFollow implements Serializable {
private
String
reconciliationCompany
;
/**
* 对账公司编码
*/
private
String
reconciliationCompanyCode
;
/**
* 对账公司业务id
*/
private
String
reconciliationCompanyBizId
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyFollowService.java
View file @
1ab9c9fc
...
...
@@ -96,7 +96,7 @@ public interface PolicyFollowService extends IService<PolicyFollow> {
* @param policyBizId 新单跟进业务ID
* @return 产品计划信息
*/
Policy
getProductPlan
(
String
policyBizId
);
Policy
Dto
getProductPlan
(
String
policyBizId
);
/**
* 查询投保人信息
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
View file @
1ab9c9fc
This diff is collapsed.
Click to expand it.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
View file @
1ab9c9fc
...
...
@@ -89,6 +89,8 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
private
FnaService
fnaService
;
@Resource
private
ApiInsuranceReconciliationCompanyFeignClient
apiInsuranceReconciliationCompanyFeignClient
;
@Resource
private
CustomerService
customerService
;
@Override
...
...
@@ -199,6 +201,12 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 复制属性,排除系统字段
BeanUtils
.
copyProperties
(
policyFollowDto
,
policyFollow
,
"id"
,
"policyBizId"
,
"brokerList"
);
if
(
StringUtils
.
isNotBlank
(
policyFollowDto
.
getReconciliationCode
()))
{
policyFollow
.
setReconciliationCompanyCode
(
policyFollowDto
.
getReconciliationCode
());
}
if
(
StringUtils
.
isNotBlank
(
policyFollowDto
.
getReconciliationCompanyName
()))
{
policyFollow
.
setReconciliationCompany
(
policyFollowDto
.
getReconciliationCompanyName
());
}
// 检查保单号是否从空变为有值
String
oldPolicyNo
=
policyFollow
.
getPolicyNo
();
...
...
@@ -484,8 +492,17 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 如果是生效状态,同步保单、预计发佣、预计来佣
if
(
PolicyFollowStatusEnum
.
EFFECTIVE
.
equals
(
policyFollowStatusEnum
))
{
Policy
policy
=
new
Policy
();
BeanUtils
.
copyProperties
(
policyFollow
,
policy
,
"id"
);
Policy
policy
=
policyService
.
getOne
(
new
QueryWrapper
<
Policy
>().
eq
(
"policy_biz_id"
,
policyBizId
));
if
(
policy
==
null
)
{
throw
new
BusinessException
(
ErrorCode
.
NOT_FOUND_ERROR
.
getCode
(),
"policy不存在"
);
}
policy
.
setPolicyNo
(
policyFollow
.
getPolicyNo
());
policy
.
setPaymentPremium
(
policyFollow
.
getEachIssuePremium
());
policy
.
setPolicyHolderAge
(
calculatePolicyHolderAge
(
policyFollow
.
getCustomerBizId
()));
policy
.
setEffectiveDate
(
policyFollow
.
getEffectiveDate
());
policy
.
setCoolingOffEndDate
(
policyFollow
.
getCoolingOffEndDate
());
policy
.
setPaymentTerm
(
policyFollow
.
getIssueNumber
());
// 更新保单状态为生效
policy
.
setStatus
(
PolicyStatusEnum
.
INFORCE
.
getItemValue
());
// 手动映射不同名的字段
policy
.
setPaymentPremium
(
policyFollow
.
getInitialPremium
());
...
...
@@ -493,39 +510,37 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
policy
.
setPaymentTerm
(
policyFollow
.
getIssueNumber
());
policy
.
setUnderwritingDate
(
changePolicyFollowStatusRequest
.
getUnderwritingDate
());
policy
.
setEffectiveDate
(
changePolicyFollowStatusRequest
.
getEffectiveDate
());
policy
.
setPolicyHolderAge
(
calculatePolicyHolderAge
(
policyFollow
.
getCustomerBizId
()));
if
(
ObjectUtils
.
isEmpty
(
policy
.
getInsuranceCompany
())
||
ObjectUtils
.
isEmpty
(
policy
.
get
ReconciliationCompanyBizId
()))
{
if
(
ObjectUtils
.
isEmpty
(
policy
.
getInsuranceCompany
())
||
ObjectUtils
.
isEmpty
(
policy
.
get
InsuranceCompany
()))
{
// 获取保单产品信息,填充对账公司相关字段
PolicyProductInfo
productInfo
=
getPolicyProductInfo
(
policyFollow
.
getProductLaunchBizId
());
if
(
productInfo
!=
null
)
{
policy
.
setInsuranceCompany
(
productInfo
.
getInsuranceCompany
());
policy
.
setInsuranceCompanyBizId
(
productInfo
.
getInsuranceCompanyBizId
());
policy
.
setReconciliationCompany
(
productInfo
.
getReconciliationCompany
());
policy
.
setReconciliationCompanyBizId
(
productInfo
.
getReconciliationCompanyBizId
());
// 调用对账公司 feignclient,查询对账公司编码
String
reconciliationCompanyCode
=
queryReconciliationCompanyByFeign
(
policy
.
getReconciliationCompanyBizId
());
// 如果仍然没有获取到编码,抛异常
if
(
StringUtils
.
isBlank
(
reconciliationCompanyCode
))
{
throw
new
BusinessException
(
"未能从对账公司服务获取编码,请补充,当前对账公司:"
+
productInfo
.
getReconciliationCompany
());
if
(
ObjectUtils
.
isEmpty
(
policy
.
getReconciliationCompany
()))
{
policy
.
setReconciliationCompany
(
productInfo
.
getReconciliationCompany
());
}
if
(
ObjectUtils
.
isEmpty
(
policy
.
getReconciliationCompanyBizId
()))
{
policy
.
setReconciliationCompanyBizId
(
productInfo
.
getReconciliationCompanyBizId
());
}
policy
.
setReconciliationCompanyCode
(
reconciliationCompanyCode
);
}
}
// 保存保单
try
{
policyService
.
save
(
policy
);
}
catch
(
DuplicateKeyException
e
)
{
// 保单号已存在
throw
new
BusinessException
(
"保单号 "
+
policy
.
getPolicyNo
()
+
" 已存在,请勿重复添加"
);
}
policyService
.
updateById
(
policy
);
// 更新转介人保单号
updatePolicyBrokerPolicyNo
(
policyBizId
,
policy
.
getPolicyNo
());
// 根据保单生成预计入账记录
generateExpectedCommission
(
policyFollow
,
policy
);
// 更新FNA状态为 "签单完成"
fnaService
.
update
(
new
UpdateWrapper
<
Fna
>()
.
set
(
"status"
,
FnaStatusEnum
.
SIGNED_COMPLETED
.
getItemValue
())
.
set
(
"policy_no"
,
policy
.
getPolicyNo
())
.
eq
(
"fna_biz_id"
,
policyFollow
.
getFnaBizId
()));
}
// 新增新单状态记录
...
...
@@ -541,6 +556,18 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
return
true
;
}
private
Integer
calculatePolicyHolderAge
(
String
customerBizId
)
{
Customer
customer
=
customerService
.
getByCustomerBizId
(
customerBizId
);
if
(
customer
==
null
)
{
throw
new
BusinessException
(
"客户不存在"
);
}
if
(
customer
.
getBirthday
()
==
null
)
{
throw
new
BusinessException
(
"客户生日不能为空"
);
}
// 根据生日计算年龄
return
DateUtil
.
ageOfNow
(
customer
.
getBirthday
());
}
/**
* 调用对账公司 feignclient,查询对账公司编码
*/
...
...
@@ -963,8 +990,13 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
}
@Override
public
Policy
getProductPlan
(
String
policyBizId
)
{
return
policyService
.
getOne
(
new
QueryWrapper
<
Policy
>().
eq
(
"policy_biz_id"
,
policyBizId
).
eq
(
"is_deleted"
,
0
));
public
PolicyDto
getProductPlan
(
String
policyBizId
)
{
Policy
policy
=
policyService
.
getOne
(
new
QueryWrapper
<
Policy
>().
eq
(
"policy_biz_id"
,
policyBizId
));
List
<
PolicyAdditional
>
policyAdditionalList
=
policyAdditionalService
.
lambdaQuery
()
.
eq
(
PolicyAdditional:
:
getPolicyBizId
,
policyBizId
)
.
list
();
// 转换为DTO
return
PolicyDto
.
convertToDto
(
policy
,
policyAdditionalList
);
}
@Override
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
View file @
1ab9c9fc
...
...
@@ -53,7 +53,6 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
@Resource
private
PolicyAdditionalService
policyAdditionalService
;
@Resource
private
ApiRelProjectProductLaunchFeignClient
apiRelProjectProductLaunchFeignClient
;
...
...
@@ -148,7 +147,6 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
policyAdditionalService
.
saveBatch
(
policyAdditionalList
);
}
policy
.
setUpdateTime
(
now
);
return
true
;
}
...
...
yd-csf-service/src/main/resources/mappers/PolicyMapper.xml
View file @
1ab9c9fc
...
...
@@ -17,6 +17,7 @@
<result
property=
"insuranceCompanyBizId"
column=
"insurance_company_biz_id"
/>
<result
property=
"region"
column=
"region"
/>
<result
property=
"policyHolder"
column=
"policy_holder"
/>
<result
property=
"policyHolderAge"
column=
"policy_holder_age"
/>
<result
property=
"insured"
column=
"insured"
/>
<result
property=
"sumInsured"
column=
"sum_insured"
/>
<result
property=
"paymentTerm"
column=
"payment_term"
/>
...
...
@@ -55,7 +56,7 @@
<sql
id=
"Base_Column_List"
>
id,policy_biz_id,policy_no,user_biz_id,product_launch_biz_id,product_code,
product_name,product_cate,insurance_company,insurance_company_biz_id,region,
policy_holder,insured,sum_insured,payment_term,payment_frequency,payment_premium,
policy_holder,
policy_holder_age,
insured,sum_insured,payment_term,payment_frequency,payment_premium,
status,currency,initial_premium,sign_date,issue_date,
effective_date,cooling_off_end_date,cooling_off_days,renewal_date,is_prepaid,deductibles,prepaid_term,
initial_payment_method,renewal_payment_method,dividend_distribution_method,is_backtrack,is_join,
...
...
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