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
5054dc00
Commit
5054dc00
authored
Oct 15, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
d558ac61
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
13 deletions
+128
-13
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentFileServiceImpl.java
+22
-1
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAdditionalDto.java
+4
-2
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAppointmentDto.java
+89
-4
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportBeneficiaryDto.java
+13
-6
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentFileServiceImpl.java
View file @
5054dc00
...
...
@@ -376,8 +376,17 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
apiProductPlanMainInfoDto
=
ApiExcelImportAppointmentDto
.
buildApiProductPlanMainInfoDto
(
appointmentDto
,
apiProductPlanMainInfoDto
,
dictTypeResponses
);
BeanUtils
.
copyProperties
(
apiProductPlanMainInfoDto
,
productPlan
);
iProductPlanService
.
saveOrUpdate
(
productPlan
);
//新增附加计划(附加险列表)
List
<
ApiProductPlanAdditionalInfoDto
>
apiBeneficiaryInfoDtoList
=
ApiExcelImportAppointmentDto
.
buildApiProductPlanAdditionalInfoDto
(
appointmentDto
.
getAdditionalDtoList
(),
dictTypeResponses
,
productPlan
.
getPlanBizId
());
if
(!
CollectionUtils
.
isEmpty
(
apiBeneficiaryInfoDtoList
))
{
List
<
Additional
>
saveList
=
apiBeneficiaryInfoDtoList
.
stream
().
map
(
dto
->
{
Additional
additional
=
new
Additional
();
BeanUtils
.
copyProperties
(
dto
,
additional
);
return
additional
;
}).
collect
(
Collectors
.
toList
());
iAdditionalService
.
saveOrUpdateBatch
(
saveList
);
}
}
//编辑更新附加计划(附加险列表)TODO
//编辑更新投保人信息
//查询投保人信息
...
...
@@ -411,6 +420,18 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
BeanUtils
.
copyProperties
(
apiSecondHolderInfoDto
,
secondHolder
);
iSecondHolderService
.
saveOrUpdate
(
secondHolder
);
}
//新增受益人列表
List
<
ApiBeneficiaryInfoDto
>
apiBeneficiaryInfoDtoList
=
ApiExcelImportAppointmentDto
.
buildApiBeneficiaryInfoDtoList
(
appointmentDto
.
getBeneficiaryDtoList
(),
dictTypeResponses
,
request
.
getAppointmentBizId
());
if
(!
CollectionUtils
.
isEmpty
(
apiBeneficiaryInfoDtoList
))
{
List
<
Beneficiary
>
saveList
=
apiBeneficiaryInfoDtoList
.
stream
().
map
(
dto
->
{
Beneficiary
beneficiary
=
new
Beneficiary
();
BeanUtils
.
copyProperties
(
dto
,
beneficiary
);
return
beneficiary
;
}).
collect
(
Collectors
.
toList
());
iBeneficiaryService
.
saveOrUpdateBatch
(
saveList
);
}
return
Result
.
success
();
}
catch
(
Exception
e
)
{
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAdditionalDto.java
View file @
5054dc00
...
...
@@ -10,13 +10,14 @@ public class ApiExcelImportAdditionalDto {
/**
* 保险附加产品名称(中台保险附加产品名称,冗余)
* 同时作为结束标志字段
*/
@ExcelField
(
name
=
"
保险附加产品名称"
,
titleRow
=
20
,
titleCol
=
0
,
valueRow
=
2
0
,
valueCol
=
1
)
@ExcelField
(
name
=
"
附约计划"
,
titleRow
=
0
,
titleCol
=
0
,
valueRow
=
0
,
valueCol
=
1
)
private
String
addProductName
;
/**
* 保费
*/
@ExcelField
(
name
=
"
保险附加产品名称"
,
titleRow
=
20
,
titleCol
=
1
,
valueRow
=
20
,
valueCol
=
2
)
@ExcelField
(
name
=
"
附约计划首期保費金額"
,
titleRow
=
0
,
titleCol
=
2
,
valueRow
=
0
,
valueCol
=
3
)
private
BigDecimal
addPremium
;
}
\ No newline at end of file
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAppointmentDto.java
View file @
5054dc00
package
com
.
yd
.
csf
.
feign
.
dto
.
excel
;
import
com.yd.common.enums.CommonEnum
;
import
com.yd.common.enums.DictTypeEnum
;
import
com.yd.common.utils.ChineseTextConverter
;
import
com.yd.common.utils.DateUtil
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.common.utils.StringUtil
;
import
com.yd.csf.feign.dto.appointment.*
;
import
com.yd.oss.feign.annotation.ExcelCollection
;
...
...
@@ -10,8 +12,13 @@ import com.yd.oss.feign.annotation.ExcelField;
import
com.yd.oss.feign.annotation.ExcelSheet
;
import
com.yd.user.feign.response.sysdict.GetDictItemListByDictTypeResponse
;
import
lombok.Data
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Data
@ExcelSheet
(
sheetIndex
=
0
)
...
...
@@ -462,16 +469,33 @@ public class ApiExcelImportAppointmentDto {
@ExcelField
(
name
=
"與受保人關係"
,
titleRow
=
87
,
titleCol
=
1
,
valueRow
=
87
,
valueCol
=
2
)
private
String
secondHolderInsurantRel
;
//============以下是受益人列表信息============
/**
* 受益人列表信息
*/
@ExcelCollection
(
type
=
ApiExcelImportBeneficiaryDto
.
class
,
startRow
=
64
)
* 每个受益人占用3行数据(64-66, 67-69, 70-72...)
*/
@ExcelCollection
(
type
=
ApiExcelImportBeneficiaryDto
.
class
,
startRow
=
64
,
rowSpan
=
4
,
groupMode
=
ExcelCollection
.
GroupMode
.
FIXED_ROW_SPAN
,
// endFlagField = "beneficiaryName",
nextFieldTitle
=
"第二持有人资料(只适用儿童单)"
)
private
List
<
ApiExcelImportBeneficiaryDto
>
beneficiaryDtoList
;
/**
* 附加计划(附加险)列表信息
* 附加计划列表信息
* 单行模式,使用下一个对象的"保单币别"标题作为结束标志
*/
@ExcelCollection
(
type
=
ApiExcelImportAdditionalDto
.
class
,
startRow
=
20
)
@ExcelCollection
(
type
=
ApiExcelImportAdditionalDto
.
class
,
startRow
=
20
,
rowSpan
=
1
,
groupMode
=
ExcelCollection
.
GroupMode
.
FIXED_ROW_SPAN
,
endFlagField
=
"addProductName"
,
nextFieldTitle
=
"保单币别"
// 新增:下一个对象的第一个字段标题
)
private
List
<
ApiExcelImportAdditionalDto
>
additionalDtoList
;
/**
...
...
@@ -684,4 +708,65 @@ public class ApiExcelImportAppointmentDto {
infoDto
.
setNameEn
(
dto
.
getSecondHolderNameEn
());
return
infoDto
;
}
/**
* 构造受益人列表
* @param dtoList
* @param dictTypeResponses
* @return
*/
public
static
List
<
ApiBeneficiaryInfoDto
>
buildApiBeneficiaryInfoDtoList
(
List
<
ApiExcelImportBeneficiaryDto
>
dtoList
,
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
,
String
appointmentBizId
)
{
List
<
ApiBeneficiaryInfoDto
>
infoDtoList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
dtoList
))
{
infoDtoList
=
dtoList
.
stream
().
map
(
dto
->
{
ApiBeneficiaryInfoDto
infoDto
=
new
ApiBeneficiaryInfoDto
();
infoDto
.
setBeneficiaryBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_BENEFICIARY
.
getCode
()));
infoDto
.
setAppointmentBizId
(
appointmentBizId
);
//受益比例
infoDto
.
setBenefitRatio
(
dto
.
getBeneficiaryBenefitRatio
());
//出生日期
infoDto
.
setBirthTime
(
DateUtil
.
getYMDLocalDateTime
(
dto
.
getBeneficiaryBirthTime
()));
//中文姓名
infoDto
.
setName
(
dto
.
getBeneficiaryName
());
//名字-英文
infoDto
.
setNameEn
(
dto
.
getBeneficiaryNameEn
());
//证件号码
infoDto
.
setIdNumber
(
dto
.
getBeneficiaryIdNumber
());
//与受保人关系
infoDto
.
setInsurantRel
(
GetDictItemListByDictTypeResponse
.
getItemValue
(
dictTypeResponses
,
DictTypeEnum
.
CSF_AP_REL
.
getItemValue
(),
ChineseTextConverter
.
traditionalToSimplified
(
dto
.
getBeneficiaryInsurantRel
())));
return
infoDto
;
}).
collect
(
Collectors
.
toList
());
}
return
infoDtoList
;
}
/**
* 构造附加计划(附加险)列表
* @param dtoList
* @param dictTypeResponses
* @param planBizId
* @return
*/
public
static
List
<
ApiProductPlanAdditionalInfoDto
>
buildApiProductPlanAdditionalInfoDto
(
List
<
ApiExcelImportAdditionalDto
>
dtoList
,
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
,
String
planBizId
)
{
List
<
ApiProductPlanAdditionalInfoDto
>
infoDtoList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
dtoList
))
{
infoDtoList
=
dtoList
.
stream
().
map
(
dto
->
{
ApiProductPlanAdditionalInfoDto
infoDto
=
new
ApiProductPlanAdditionalInfoDto
();
infoDto
.
setAdditionalBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_ADDITIONAL
.
getCode
()));
infoDto
.
setPlanBizId
(
planBizId
);
//保险附加产品名称
infoDto
.
setAddProductName
(
dto
.
getAddProductName
());
//保费
infoDto
.
setPremium
(
dto
.
getAddPremium
());
return
infoDto
;
}).
collect
(
Collectors
.
toList
());
}
return
infoDtoList
;
}
}
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportBeneficiaryDto.java
View file @
5054dc00
...
...
@@ -13,37 +13,43 @@ public class ApiExcelImportBeneficiaryDto {
/**
* 中文姓名(受益人信息表:名字)
* 相对行号:每个受益人组内的第0行
*/
@ExcelField
(
name
=
"中文姓名"
,
titleRow
=
64
,
titleCol
=
0
,
valueRow
=
64
,
valueCol
=
1
)
@ExcelField
(
name
=
"中文姓名"
,
titleRow
=
0
,
titleCol
=
0
,
valueRow
=
0
,
valueCol
=
1
)
private
String
beneficiaryName
;
/**
* 英文姓名 (同护照)(受益人信息表:名字-英文)
* 相对行号:每个受益人组内的第0行
*/
@ExcelField
(
name
=
"英文姓名"
,
titleRow
=
64
,
titleCol
=
2
,
valueRow
=
64
,
valueCol
=
3
)
@ExcelField
(
name
=
"英文姓名"
,
titleRow
=
0
,
titleCol
=
2
,
valueRow
=
0
,
valueCol
=
3
)
private
String
beneficiaryNameEn
;
/**
* 出生日期 (西元 年/月/日)(受益人信息表:出生日期)
* 相对行号:每个受益人组内的第1行
*/
@ExcelField
(
name
=
"出生日期"
,
titleRow
=
65
,
titleCol
=
0
,
valueRow
=
65
,
valueCol
=
1
)
@ExcelField
(
name
=
"出生日期"
,
titleRow
=
1
,
titleCol
=
0
,
valueRow
=
1
,
valueCol
=
1
)
private
String
beneficiaryBirthTime
;
/**
* 身份证号码(受益人信息表:证件号码)
* 相对行号:每个受益人组内的第1行
*/
@ExcelField
(
name
=
"身份证号码"
,
titleRow
=
65
,
titleCol
=
2
,
valueRow
=
65
,
valueCol
=
3
)
@ExcelField
(
name
=
"身份证号码"
,
titleRow
=
1
,
titleCol
=
2
,
valueRow
=
1
,
valueCol
=
3
)
private
String
beneficiaryIdNumber
;
/**
* 與受保人關係(受益人信息表:与受保人关系(字典))
* 相对行号:每个受益人组内的第2行
*/
@ExcelField
(
name
=
"與受保人關係"
,
titleRow
=
66
,
titleCol
=
0
,
valueRow
=
66
,
valueCol
=
1
)
@ExcelField
(
name
=
"與受保人關係"
,
titleRow
=
2
,
titleCol
=
0
,
valueRow
=
2
,
valueCol
=
1
)
private
String
beneficiaryInsurantRel
;
/**
* 受益比例 (%)(受益人信息表:受益比例)
* 相对行号:每个受益人组内的第2行
*/
@ExcelField
(
name
=
"受益比例 (%)"
,
titleRow
=
66
,
titleCol
=
2
,
valueRow
=
66
,
valueCol
=
3
)
@ExcelField
(
name
=
"受益比例 (%)"
,
titleRow
=
2
,
titleCol
=
2
,
valueRow
=
2
,
valueCol
=
3
)
private
BigDecimal
beneficiaryBenefitRatio
;
}
\ No newline at end of file
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