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
b7891caa
Commit
b7891caa
authored
Jan 29, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
b0a64047
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
69 deletions
+55
-69
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiAppointmentFileController.java
+1
-1
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentFileServiceImpl.java
+21
-65
yd-csf-feign/src/main/java/com/yd/csf/feign/client/appointmentfile/ApiAppointmentFileFeignClient.java
+1
-1
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAppointmentDto.java
+0
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/appointmentfile/ApiAppointmentImportExcelResponse.java
+30
-0
yd-csf-service/src/main/java/com/yd/csf/service/model/ProductPlan.java
+2
-2
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiAppointmentFileController.java
View file @
b7891caa
...
...
@@ -117,7 +117,7 @@ public class ApiAppointmentFileController implements ApiAppointmentFileFeignClie
}
/**
* Excel导入-预约信息
* Excel导入-
解析Excel
预约信息
* @return
*/
@Override
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentFileServiceImpl.java
View file @
b7891caa
...
...
@@ -349,7 +349,7 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
/**
* Excel导入-预约信息
* Excel导入-
解析Excel
预约信息
* @param file
* @param request
* @return
...
...
@@ -357,22 +357,17 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
@Override
public
Result
<
ApiAppointmentImportExcelResponse
>
appointmentImportExcel
(
MultipartFile
file
,
ApiAppointmentImportExcelRequest
request
)
{
//校验预约信息是否存在
Result
<
Appointment
>
appointmentResult
=
apiAppointmentService
.
checkAppointmentIsExist
(
request
.
getAppointmentBizId
());
Appointment
appointment
=
appointmentResult
.
getData
();
ApiAppointmentImportExcelResponse
response
=
new
ApiAppointmentImportExcelResponse
();
String
s
=
"com.yd.csf.feign.dto.excel.ApiExcelImportAppointmentDto,com.yd.csf.feign.dto.excel.ApiExcelImportHealthDto"
;
//Feign调用-oss服务,通用-Excel解析(支持多sheet页解析)
Result
<
ApiOssExcelParseResponse
>
result
=
apiExcelFeignClient
.
parse
(
file
,
s
);
if
(
Objects
.
isNull
(
result
.
getData
())
||
(!
Objects
.
isNull
(
result
.
getData
())
&&
Objects
.
isNull
(
result
.
getData
().
getMap
()))){
throw
new
BusinessException
(
"导入数据不能为空!"
);
}
//Excel解析出的信息
Map
<
Integer
,
Object
>
data
=
(
Map
<
Integer
,
Object
>)
result
.
getData
().
getMap
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
try
{
...
...
@@ -382,83 +377,44 @@ public class ApiAppointmentFileServiceImpl implements ApiAppointmentFileService
LinkedHashMap
<
String
,
Object
>
appointmentData
=
(
LinkedHashMap
<
String
,
Object
>)
data
.
get
(
0
);
ApiExcelImportAppointmentDto
appointmentDto
=
objectMapper
.
convertValue
(
appointmentData
,
ApiExcelImportAppointmentDto
.
class
);
// 获取第二个Sheet页的解析结果并转换为 DTO
// LinkedHashMap<String, Object> healthData = (LinkedHashMap<String, Object>) data.get(1);
// ApiExcelImportHealthDto healthDto = objectMapper.convertValue(healthData, ApiExcelImportHealthDto.class);
//编辑更新预约主体信息
//设置预约主体信息
ApiAppointmentInfoDto
apiAppointmentInfoDto
=
new
ApiAppointmentInfoDto
();
BeanUtils
.
copyProperties
(
appointment
,
apiAppointmentInfoDto
);
apiAppointmentInfoDto
=
ApiExcelImportAppointmentDto
.
buildApiAppointmentInfoDto
(
appointmentDto
,
apiAppointmentInfoDto
,
dictTypeResponses
);
BeanUtils
.
copyProperties
(
apiAppointmentInfoDto
,
appointment
);
iAppointmentService
.
saveOrUpdate
(
appointment
);
response
.
setApiAppointmentInfoDto
(
apiAppointmentInfoDto
);
//编辑更新产品计划主信息
//查询产品计划主信息
ProductPlan
productPlan
=
iProductPlanService
.
queryOne
(
request
.
getAppointmentBizId
(),
""
);
//设置产品计划主信息
ApiProductPlanInfoDto
apiProductPlanInfoDto
=
new
ApiProductPlanInfoDto
();
ApiProductPlanMainInfoDto
apiProductPlanMainInfoDto
=
new
ApiProductPlanMainInfoDto
();
if
(!
Objects
.
isNull
(
productPlan
))
{
BeanUtils
.
copyProperties
(
productPlan
,
apiProductPlanMainInfoDto
);
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
);
}
}
apiProductPlanInfoDto
.
setApiProductPlanMainInfoDto
(
apiProductPlanMainInfoDto
);
//设置产品附加计划(附加险列表)
List
<
ApiProductPlanAdditionalInfoDto
>
apiProductPlanAdditionalInfoDtoList
=
ApiExcelImportAppointmentDto
.
buildApiProductPlanAdditionalInfoDto
(
appointmentDto
.
getAdditionalDtoList
(),
dictTypeResponses
);
apiProductPlanInfoDto
.
setApiProductPlanAdditionalInfoDtoList
(
apiProductPlanAdditionalInfoDtoList
);
response
.
setApiProductPlanInfoDto
(
apiProductPlanInfoDto
);
//编辑更新投保人信息
//查询投保人信息
Policyholder
policyholder
=
iPolicyholderService
.
queryOne
(
request
.
getAppointmentBizId
(),
""
);
//设置投保人信息
ApiPolicyholderInfoDto
apiPolicyholderInfoDto
=
new
ApiPolicyholderInfoDto
();
if
(!
Objects
.
isNull
(
policyholder
))
{
BeanUtils
.
copyProperties
(
policyholder
,
apiPolicyholderInfoDto
);
apiPolicyholderInfoDto
=
ApiExcelImportAppointmentDto
.
buildApiPolicyholderInfoDto
(
appointmentDto
,
apiPolicyholderInfoDto
,
dictTypeResponses
);
BeanUtils
.
copyProperties
(
apiPolicyholderInfoDto
,
policyholder
);
iPolicyholderService
.
saveOrUpdate
(
policyholder
);
}
response
.
setApiPolicyholderInfoDto
(
apiPolicyholderInfoDto
);
//编辑更新受保人信息
//查询受保人信息
Insurant
insurant
=
iInsurantService
.
queryOne
(
request
.
getAppointmentBizId
(),
""
);
//设置受保人信息
ApiInsurantInfoDto
apiInsurantInfoDto
=
new
ApiInsurantInfoDto
();
if
(!
Objects
.
isNull
(
insurant
))
{
BeanUtils
.
copyProperties
(
insurant
,
apiInsurantInfoDto
);
apiInsurantInfoDto
=
ApiExcelImportAppointmentDto
.
buildApiInsurantInfoDto
(
appointmentDto
,
apiInsurantInfoDto
,
dictTypeResponses
);
BeanUtils
.
copyProperties
(
apiInsurantInfoDto
,
insurant
);
iInsurantService
.
saveOrUpdate
(
insurant
);
}
response
.
setApiInsurantInfoDto
(
apiInsurantInfoDto
);
//编辑更新第二持有人信息
//查询第二持有人信息
SecondHolder
secondHolder
=
iSecondHolderService
.
queryOne
(
request
.
getAppointmentBizId
(),
""
);
ApiSecondHolderInfoDto
apiSecondHolderInfoDto
=
new
ApiSecondHolderInfoDto
();
if
(!
Objects
.
isNull
(
secondHolder
))
{
BeanUtils
.
copyProperties
(
secondHolder
,
apiSecondHolderInfoDto
);
apiSecondHolderInfoDto
=
ApiExcelImportAppointmentDto
.
buildApiSecondHolderInfoDto
(
appointmentDto
,
apiSecondHolderInfoDto
,
dictTypeResponses
);
BeanUtils
.
copyProperties
(
apiSecondHolderInfoDto
,
secondHolder
);
iSecondHolderService
.
saveOrUpdate
(
secondHolder
);
}
response
.
setApiSecondHolderInfoDto
(
apiSecondHolderInfoDto
);
//新增受益人列表
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
);
}
List
<
ApiBeneficiaryInfoDto
>
apiBeneficiaryInfoDtoList
=
ApiExcelImportAppointmentDto
.
buildApiBeneficiaryInfoDtoList
(
appointmentDto
.
getBeneficiaryDtoList
(),
dictTypeResponses
);
ApiBeneficiaryInfoFzDto
fzDto
=
new
ApiBeneficiaryInfoFzDto
();
fzDto
.
setApiBeneficiaryInfoDtoList
(
apiBeneficiaryInfoDtoList
);
response
.
setApiBeneficiaryInfoFzDto
(
fzDto
);
return
Result
.
success
();
return
Result
.
success
(
response
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Excel数据转换异常"
,
e
);
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/client/appointmentfile/ApiAppointmentFileFeignClient.java
View file @
b7891caa
...
...
@@ -87,7 +87,7 @@ public interface ApiAppointmentFileFeignClient {
Result
<
ApiAppointmentExportExcelResponse
>
appointmentExportExcel
(
@NotBlank
(
message
=
"预约信息主表唯一业务ID不能为空"
)
@RequestParam
(
value
=
"appointmentBizId"
)
String
appointmentBizId
);
/**
* Excel导入-预约信息
* Excel导入-
解析Excel
预约信息
* @return
*/
@PostMapping
(
value
=
"/excel/import/appointment"
)
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/excel/ApiExcelImportAppointmentDto.java
View file @
b7891caa
This diff is collapsed.
Click to expand it.
yd-csf-feign/src/main/java/com/yd/csf/feign/response/appointmentfile/ApiAppointmentImportExcelResponse.java
View file @
b7891caa
package
com
.
yd
.
csf
.
feign
.
response
.
appointmentfile
;
import
com.yd.csf.feign.dto.appointment.*
;
import
lombok.Data
;
@Data
public
class
ApiAppointmentImportExcelResponse
{
/**
* 预约信息(包含签约信息)
*/
private
ApiAppointmentInfoDto
apiAppointmentInfoDto
;
/**
* 产品计划信息
*/
private
ApiProductPlanInfoDto
apiProductPlanInfoDto
;
/**
* 投保人信息
*/
private
ApiPolicyholderInfoDto
apiPolicyholderInfoDto
;
/**
* 受保人信息
*/
private
ApiInsurantInfoDto
apiInsurantInfoDto
;
/**
* 受益人封装对象
*/
private
ApiBeneficiaryInfoFzDto
apiBeneficiaryInfoFzDto
;
/**
* 第二持有人信息
*/
private
ApiSecondHolderInfoDto
apiSecondHolderInfoDto
;
}
yd-csf-service/src/main/java/com/yd/csf/service/model/ProductPlan.java
View file @
b7891caa
...
...
@@ -83,8 +83,8 @@ public class ProductPlan implements Serializable {
/**
* 产品上架信息表名称(标题)
*/
@TableField
(
"product_launch_name"
)
private
String
productLaunchName
;
@TableField
(
"product_launch_
main_
name"
)
private
String
productLaunch
Main
Name
;
/**
* 供款期数
...
...
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