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
e6b5ac3a
Commit
e6b5ac3a
authored
Nov 03, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新单跟进16
parent
96ab2b60
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
527 additions
and
4 deletions
+527
-4
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyController.java
+16
-0
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
+31
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyFollowAggregateDto.java
+6
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyPolicyholderUpdateRequest.java
+446
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyService.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
+25
-4
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyController.java
View file @
e6b5ac3a
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yd.common.enums.ResultCode
;
import
com.yd.common.result.Result
;
import
com.yd.csf.service.dto.CommissionExpectedQueryRequest
;
import
com.yd.csf.service.dto.PolicyPolicyholderUpdateRequest
;
import
com.yd.csf.service.dto.PolicyQueryRequest
;
import
com.yd.csf.service.dto.PolicyUpdateRequest
;
...
...
@@ -98,6 +99,21 @@ public class ApiPolicyController {
}
/**
* 更新投保人信息
*
* @param policyUpdateRequest
* @return
*/
@PostMapping
(
"/update_policyholder"
)
@Operation
(
summary
=
"更新保单投保人信息"
)
public
Result
<
Boolean
>
updatePolicyholder
(
@RequestBody
PolicyPolicyholderUpdateRequest
policyUpdateRequest
)
{
if
(
policyUpdateRequest
==
null
||
policyUpdateRequest
.
getPolicyPolicyholderBizId
()
==
null
)
{
return
Result
.
fail
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"policyPolicyholderBizId不能为空"
);
}
return
Result
.
success
(
policyService
.
updatePolicyholder
(
policyUpdateRequest
));
}
/**
* 根据 policyBizId 获取保单(封装类)
*
* @param policyBizId
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
View file @
e6b5ac3a
...
...
@@ -36,6 +36,7 @@ import org.springframework.util.CollectionUtils;
import
javax.annotation.Resource
;
import
java.time.ZoneId
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
...
...
@@ -92,6 +93,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
private
PolicyBeneficiaryService
policyBeneficiaryService
;
@Resource
private
PolicySecondHolderService
policySecondHolderService
;
@Resource
private
PolicyAdditionalService
policyAdditionalService
;
/**
* 预约分页查询
...
...
@@ -411,11 +414,14 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
Result
<
ApiAppointmentDetailResponse
>
result
=
detail
(
appointment
.
getAppointmentBizId
());
ApiAppointmentDetailResponse
response
=
result
.
getData
();
ApiProductPlanMainInfoDto
apiProductPlanMainInfoDto
=
null
;
List
<
ApiProductPlanAdditionalInfoDto
>
apiProductPlanAdditionalInfoDtoList
=
new
ArrayList
<>();
ApiInsurantInfoDto
apiInsurantInfoDto
=
null
;
if
(!
Objects
.
isNull
(
response
)
&&
!
Objects
.
isNull
(
response
.
getApiProductPlanInfoDto
())
&&
!
Objects
.
isNull
(
response
.
getApiProductPlanInfoDto
().
getApiProductPlanMainInfoDto
()))
{
apiProductPlanMainInfoDto
=
response
.
getApiProductPlanInfoDto
().
getApiProductPlanMainInfoDto
();
// 产品计划附加险列表
apiProductPlanAdditionalInfoDtoList
=
response
.
getApiProductPlanInfoDto
().
getApiProductPlanAdditionalInfoDtoList
();
}
if
(!
Objects
.
isNull
(
response
)
&&
!
Objects
.
isNull
(
response
.
getApiInsurantInfoDto
()))
{
...
...
@@ -480,6 +486,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
// 同步保存保单(产品计划)
savePolicy
(
follow
,
apiProductPlanMainInfoDto
,
policyBizId
);
// 同步保存保单产品计划附加险
savePolicyAdditional
(
apiProductPlanAdditionalInfoDtoList
,
policyBizId
);
// 同步保存保单投保人
savePolicyPolicyholder
(
apiInsurantInfoDto
,
policyBizId
);
// 同步保存保单受保人
...
...
@@ -488,10 +496,33 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
savePolicyBeneficiary
(
apiInsurantInfoDto
,
policyBizId
);
// 同步保存保单第二持有人
savePolicySecondHolder
(
apiInsurantInfoDto
,
policyBizId
);
// 同步问卷信息
savePolicyQuestionnaire
(
apiInsurantInfoDto
,
policyBizId
);
return
Result
.
success
();
}
private
void
savePolicyQuestionnaire
(
ApiInsurantInfoDto
apiInsurantInfoDto
,
String
policyBizId
)
{
//远程调用-问卷-答题提交接口
ApiAnswerSaveRequest
answerSaveRequest
=
new
ApiAnswerSaveRequest
();
answerSaveRequest
.
setObjectBizId
(
policyBizId
);
answerSaveRequest
.
setQuestionnaireBizId
(
"questionnaires_1001"
);
apiQuestionnairesFeignClient
.
answerSave
(
answerSaveRequest
);
}
private
void
savePolicyAdditional
(
List
<
ApiProductPlanAdditionalInfoDto
>
apiProductPlanAdditionalInfoDtoList
,
String
policyBizId
)
{
if
(!
CollectionUtils
.
isEmpty
(
apiProductPlanAdditionalInfoDtoList
))
{
apiProductPlanAdditionalInfoDtoList
.
forEach
(
apiProductPlanAdditionalInfoDto
->
{
PolicyAdditional
policyAdditional
=
new
PolicyAdditional
();
BeanUtils
.
copyProperties
(
apiProductPlanAdditionalInfoDto
,
policyAdditional
);
policyAdditional
.
setId
(
null
);
policyAdditional
.
setPolicyBizId
(
policyBizId
);
policyAdditional
.
setPolicyAdditionalBizId
(
RandomStringGenerator
.
generateBizId16
(
"policy_additional"
));
policyAdditionalService
.
saveOrUpdate
(
policyAdditional
);
});
}
}
private
boolean
savePolicySecondHolder
(
ApiInsurantInfoDto
apiInsurantInfoDto
,
String
policyBizId
)
{
PolicySecondHolder
policySecondHolder
=
new
PolicySecondHolder
();
BeanUtils
.
copyProperties
(
apiInsurantInfoDto
,
policySecondHolder
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyFollowAggregateDto.java
View file @
e6b5ac3a
...
...
@@ -30,6 +30,12 @@ public class PolicyFollowAggregateDto implements Serializable {
private
String
customerBizId
;
/**
* 问卷业务ID
*/
@Schema
(
description
=
"问卷业务ID 新单跟进问卷中,objectBizId为policyBizId"
)
private
String
questionnaireBizId
;
/**
* 保单产品计划(保单)
*/
@Schema
(
description
=
"保单产品计划(保单)"
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/PolicyPolicyholderUpdateRequest.java
0 → 100644
View file @
e6b5ac3a
package
com
.
yd
.
csf
.
service
.
dto
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
public
class
PolicyPolicyholderUpdateRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 保单投保人信息表唯一业务ID
*/
@Schema
(
description
=
"保单投保人信息表唯一业务ID"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
policyPolicyholderBizId
;
/**
* 保单号
*/
@Schema
(
description
=
"保单号"
)
private
String
policyNo
;
/**
* 客户类型(字典)
*/
@Schema
(
description
=
"客户类型(字典)"
)
private
String
customerType
;
/**
* 关联客户信息表唯一业务ID(冗余字段)
*/
@Schema
(
description
=
"关联客户信息表唯一业务ID(冗余字段)"
)
private
String
customerBizId
;
/**
* 关联客户编号(和客户信息表唯一业务ID是一对,唯一,冗余字段)
*/
@Schema
(
description
=
"关联客户编号(和客户信息表唯一业务ID是一对,唯一,冗余字段)"
)
private
String
customerNo
;
/**
* 名字
*/
@Schema
(
description
=
"名字"
)
private
String
name
;
/**
* 名字-英文
*/
@Schema
(
description
=
"名字-英文"
)
private
String
nameEn
;
/**
* 性别(字典)
*/
@Schema
(
description
=
"性别(字典)"
)
private
String
gender
;
/**
* 证件类型(字典)
*/
@Schema
(
description
=
"证件类型(字典)"
)
private
String
documentType
;
/**
* 证件号码
*/
@Schema
(
description
=
"证件号码"
)
private
String
idNumber
;
/**
* 出生日期
*/
@Schema
(
description
=
"出生日期"
)
private
Date
birthday
;
/**
* 年龄
*/
@Schema
(
description
=
"年龄"
)
private
String
age
;
/**
* 居住地址
*/
@Schema
(
description
=
"居住地址"
)
private
String
residentialAddress
;
/**
* 通讯地址
*/
@Schema
(
description
=
"通讯地址"
)
private
String
mailingAddress
;
/**
* 移动电话区号
*/
@Schema
(
description
=
"移动电话区号"
)
private
String
mobileCode
;
/**
* 移动电话
*/
@Schema
(
description
=
"移动电话"
)
private
String
mobile
;
/**
* 邮箱
*/
@Schema
(
description
=
"邮箱"
)
private
String
email
;
/**
* 公司名称
*/
@Schema
(
description
=
"公司名称"
)
private
String
companyName
;
/**
* 公司地址
*/
@Schema
(
description
=
"公司地址"
)
private
String
companyAddress
;
/**
* 行业
*/
@Schema
(
description
=
"行业"
)
private
String
industry
;
/**
* 职位
*/
@Schema
(
description
=
"职位"
)
private
String
position
;
/**
* 风险偏好(字典)
*/
@Schema
(
description
=
"风险偏好(字典)"
)
private
String
riskAppetite
;
/**
* 是否VIP: 0-否, 1-是(字典)
*/
@Schema
(
description
=
"是否VIP: 0-否, 1-是(字典)"
)
private
Integer
isVip
;
/**
* vip备注
*/
@Schema
(
description
=
"vip备注"
)
private
String
vipRemark
;
/**
* 称谓(字典)
*/
@Schema
(
description
=
"称谓(字典)"
)
private
String
appellation
;
/**
* 是否区分吸烟(字典)
*/
@Schema
(
description
=
"是否区分吸烟(字典)"
)
private
String
smokingAllowed
;
/**
* 出生地(省市)
*/
@Schema
(
description
=
"出生地(省市)"
)
private
String
birthplace
;
/**
* 国籍
*/
@Schema
(
description
=
"国籍"
)
private
String
nationality
;
/**
* 护照号码
*/
@Schema
(
description
=
"护照号码"
)
private
String
passportNo
;
/**
* 通行证号码
*/
@Schema
(
description
=
"通行证号码"
)
private
String
passNo
;
/**
* 身高
*/
@Schema
(
description
=
"身高"
)
private
String
height
;
/**
* 体重
*/
@Schema
(
description
=
"体重"
)
private
String
weight
;
/**
* BMI
*/
@Schema
(
description
=
"BMI"
)
private
String
bmi
;
/**
* 平均每月支出
*/
@Schema
(
description
=
"平均每月支出"
)
private
BigDecimal
monthExpenditure
;
/**
* 平均每月收入
*/
@Schema
(
description
=
"平均每月收入"
)
private
BigDecimal
monthIncome
;
/**
* 受雇于现职年期
*/
@Schema
(
description
=
"受雇于现职年期"
)
private
BigDecimal
currentTenure
;
/**
* 总流动资产
*/
@Schema
(
description
=
"总流动资产"
)
private
BigDecimal
totalCurrentAssets
;
/**
* 总负债额
*/
@Schema
(
description
=
"总负债额"
)
private
BigDecimal
totalDebt
;
/**
* 受供养人数目
*/
@Schema
(
description
=
"受供养人数目"
)
private
Integer
dependentsNum
;
/**
* 婚姻状况(字典)
*/
@Schema
(
description
=
"婚姻状况(字典)"
)
private
String
maritalStatus
;
/**
* 教育程度(字典)
*/
@Schema
(
description
=
"教育程度(字典)"
)
private
String
educationLevel
;
/**
* 总工作年期
*/
@Schema
(
description
=
"总工作年期"
)
private
BigDecimal
totalWorkingYears
;
/**
* 现时每月收入
*/
@Schema
(
description
=
"现时每月收入"
)
private
BigDecimal
currentMonthlyIncome
;
/**
* 公司电话区号
*/
@Schema
(
description
=
"公司电话区号"
)
private
String
companyMobileCode
;
/**
* 公司电话
*/
@Schema
(
description
=
"公司电话"
)
private
String
companyMobile
;
/**
* 固定电话区号
*/
@Schema
(
description
=
"固定电话区号"
)
private
String
landlineCode
;
/**
* 固定电话
*/
@Schema
(
description
=
"固定电话"
)
private
String
landline
;
/**
* 其他电话
*/
@Schema
(
description
=
"其他电话"
)
private
String
otherMobile
;
/**
* 过往一年是否所属国家以外地区居住超过182日: 0-否, 1-是(字典)
*/
@Schema
(
description
=
"过往一年是否所属国家以外地区居住超过182日: 0-否, 1-是(字典)"
)
private
Integer
isExceed
;
/**
* 是否拥有其他国家公民身份(如美国、日本等): 0-否, 1-是(字典)
*/
@Schema
(
description
=
"是否拥有其他国家公民身份(如美国、日本等): 0-否, 1-是(字典)"
)
private
Integer
isOtherCountry
;
/**
* 是否接受推广信息: 0-否, 1-是(字典)
*/
@Schema
(
description
=
"是否接受推广信息: 0-否, 1-是(字典)"
)
private
Integer
isPromotion
;
/**
* 投保人邮政编码
*/
@Schema
(
description
=
"投保人邮政编码"
)
private
String
postalCode
;
/**
* 旅行(字典)
*/
@Schema
(
description
=
"旅行(字典)"
)
private
String
travel
;
/**
* 运动(字典)
*/
@Schema
(
description
=
"运动(字典)"
)
private
String
exercise
;
/**
* 游戏(字典)
*/
@Schema
(
description
=
"游戏(字典)"
)
private
String
game
;
/**
* 电影/戏剧(字典)
*/
@Schema
(
description
=
"电影/戏剧(字典)"
)
private
String
movieDrama
;
/**
* 美食(字典)
*/
@Schema
(
description
=
"美食(字典)"
)
private
String
delicacy
;
/**
* 地址列表(json串)
*/
@Schema
(
description
=
"地址列表(json串)"
)
private
String
addressList
;
/**
* 吸烟量(支/天)
*/
@Schema
(
description
=
"吸烟量(支/天)"
)
private
String
smokingVolume
;
/**
* 货币(字典)
*/
@Schema
(
description
=
"货币(字典)"
)
private
String
currency
;
/**
* 公司名称(英文)
*/
@Schema
(
description
=
"公司名称(英文)"
)
private
String
companyNameEn
;
/**
* 公司商业登记号码
*/
@Schema
(
description
=
"公司商业登记号码"
)
private
String
companyBusinessNo
;
/**
* 公司注册日期
*/
@Schema
(
description
=
"公司注册日期"
)
private
Date
companyRegisterTime
;
/**
* 公司注册地区(字典)
*/
@Schema
(
description
=
"公司注册地区(字典)"
)
private
String
companyRegisterRegion
;
/**
* 公司邮箱
*/
@Schema
(
description
=
"公司邮箱"
)
private
String
companyEmail
;
/**
* 公司登记地址
*/
@Schema
(
description
=
"公司登记地址"
)
private
String
companyEnterAddress
;
/**
* 授权代表姓名中文-名字
*/
@Schema
(
description
=
"授权代表姓名中文-名字"
)
private
String
authNameCn
;
/**
* 授权代表姓名英文-名字
*/
@Schema
(
description
=
"授权代表姓名英文-名字"
)
private
String
authNameEn
;
/**
* 授权代表职称
*/
@Schema
(
description
=
"授权代表职称"
)
private
String
authProfessional
;
/**
* 授权代表电话区号
*/
@Schema
(
description
=
"授权代表电话区号"
)
private
String
authMobileCode
;
/**
* 授权代表电话
*/
@Schema
(
description
=
"授权代表电话"
)
private
String
authMobile
;
/**
* 备注
*/
@Schema
(
description
=
"备注"
)
private
String
remark
;
}
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyService.java
View file @
e6b5ac3a
...
...
@@ -3,6 +3,7 @@ package com.yd.csf.service.service;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.csf.service.dto.PolicyPolicyholderUpdateRequest
;
import
com.yd.csf.service.dto.PolicyQueryRequest
;
import
com.yd.csf.service.dto.PolicyUpdateRequest
;
import
com.yd.csf.service.model.Policy
;
...
...
@@ -21,4 +22,6 @@ public interface PolicyService extends IService<Policy> {
Page
<
PolicyVO
>
getPolicyVOPage
(
Page
<
Policy
>
policyPage
);
Boolean
updatePolicy
(
PolicyUpdateRequest
policyUpdateRequest
);
Boolean
updatePolicyholder
(
PolicyPolicyholderUpdateRequest
policyUpdateRequest
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
View file @
e6b5ac3a
...
...
@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yd.common.enums.ResultCode
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.csf.service.dto.PolicyPolicyholderUpdateRequest
;
import
com.yd.csf.service.dto.PolicyQueryRequest
;
import
com.yd.csf.service.dto.PolicyUpdateRequest
;
import
com.yd.csf.service.model.Policy
;
import
com.yd.csf.service.model.PolicyPolicyholder
;
import
com.yd.csf.service.service.PolicyPolicyholderService
;
import
com.yd.csf.service.service.PolicyService
;
import
com.yd.csf.service.dao.PolicyMapper
;
import
com.yd.csf.service.vo.PolicyVO
;
...
...
@@ -16,10 +19,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -31,6 +32,9 @@ import java.util.stream.Collectors;
public
class
PolicyServiceImpl
extends
ServiceImpl
<
PolicyMapper
,
Policy
>
implements
PolicyService
{
@Resource
private
PolicyPolicyholderService
policyPolicyholderService
;
@Override
public
QueryWrapper
<
Policy
>
getQueryWrapper
(
PolicyQueryRequest
policyQueryRequest
)
{
QueryWrapper
<
Policy
>
queryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -89,8 +93,25 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"保单不存在"
);
}
BeanUtils
.
copyProperties
(
policyUpdateRequest
,
policy
,
"policyBizId"
,
"id"
);
policy
.
setUpdateTime
(
new
Date
());
return
this
.
updateById
(
policy
);
}
@Override
public
Boolean
updatePolicyholder
(
PolicyPolicyholderUpdateRequest
policyUpdateRequest
)
{
String
policyPolicyholderBizId
=
policyUpdateRequest
.
getPolicyPolicyholderBizId
();
if
(
StringUtils
.
isBlank
(
policyPolicyholderBizId
))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"policyPolicyholderBizId不能为空"
);
}
PolicyPolicyholder
policyPolicyholder
=
policyPolicyholderService
.
getOne
(
new
QueryWrapper
<
PolicyPolicyholder
>().
eq
(
"policy_policyholder_biz_id"
,
policyPolicyholderBizId
));
if
(
policyPolicyholder
==
null
)
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"保单投保人不存在"
);
}
BeanUtils
.
copyProperties
(
policyUpdateRequest
,
policyPolicyholder
,
"policyPolicyholderBizId"
,
"id"
);
policyPolicyholder
.
setUpdateTime
(
new
Date
());
policyPolicyholder
.
setUpdateTime
(
new
Date
());
return
policyPolicyholderService
.
updateById
(
policyPolicyholder
);
}
}
...
...
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