Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
333eb914
Commit
333eb914
authored
Jul 15, 2024
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hyc-导出已投保名册中增加被替换信息
parent
a3d25282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
39 deletions
+70
-39
InsuredListVo.java
.../yifu/cloud/plus/v1/yifu/insurances/vo/InsuredListVo.java
+32
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+38
-39
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuredListVo.java
View file @
333eb914
...
...
@@ -368,4 +368,36 @@ public class InsuredListVo implements Serializable {
@Schema
(
description
=
"被替换人项目名称"
)
@ExcelIgnore
private
String
coverProjectNo
;
/**
* 替换人姓名
*/
@Schema
(
description
=
"替换人姓名"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"替换人姓名"
)
private
String
replaceEmpName
;
/**
* 替换人身份证号
*/
@Schema
(
description
=
"替换人身份证号)"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"替换人身份证号"
)
private
String
replaceEmpIdcardNo
;
/**
* 替换人项目名称
*/
@Schema
(
description
=
"替换人项目名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"替换人项目名称"
)
private
String
replaceProjectName
;
/**
* 替换人封面抬头
*/
@Schema
(
description
=
"替换人封面抬头"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"替换人封面抬头"
)
private
String
replaceInvoiceTitle
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
333eb914
...
...
@@ -4433,37 +4433,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
InsuredListVo
.
class
).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
){
Field
[]
allFields
=
InsuredListVo
.
class
.
getDeclaredFields
();
WriteSheet
writeSheet
;
ExcelUtil
<
InsuredListVo
>
util
;
//处理封面抬头
//获取所有项目信息
Map
<
String
,
ProjectSetInfoVo
>
data
=
null
;
try
{
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
new
ArrayList
<>());
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
for
(
int
i
=
0
;
i
<=
count
;
)
{
// 获取实际记录
param
.
setLimitStart
(
i
);
param
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
this
.
baseMapper
.
getInsuredList
(
param
);
if
(
Common
.
isNotNull
(
list
)){
//处理封面抬头
//根据项目编码获取项目名称
Map
<
String
,
ProjectSetInfoVo
>
data
=
null
;
try
{
List
<
String
>
collect
=
list
.
stream
().
map
(
InsuredListVo:
:
getDeptNo
).
distinct
().
collect
(
Collectors
.
toList
());
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
collect
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
data
=
null
;
}
util
=
new
ExcelUtil
<>(
InsuredListVo
.
class
);
TInsuranceReplace
one
;
TInsuranceReplace
fromOne
;
TInsuranceDetail
byId
;
ProjectSetInfoVo
coverObject
=
null
;
ProjectSetInfoVo
coverObject
;
for
(
InsuredListVo
vo:
list
){
//被替换人
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
...
...
@@ -4472,40 +4469,42 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Optional
.
ofNullable
(
one
).
isPresent
())
{
byId
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
byId
).
isPresent
())
{
//根据项目编码获取项目名称
Map
<
String
,
ProjectSetInfoVo
>
dataReplace
=
null
;
try
{
List
<
String
>
collect
=
new
ArrayList
<>();
collect
.
add
(
byId
.
getDeptNo
());
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
collect
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
dataReplace
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
dataReplace
=
null
;
}
vo
.
setCoverEmpName
(
byId
.
getEmpName
());
vo
.
setCoverEmpIdcardNo
(
byId
.
getEmpIdcardNo
());
vo
.
setCoverProjectName
(
byId
.
getDeptName
());
coverObject
=
null
;
if
(
Common
.
isNotNull
(
dataReplace
)){
coverObject
=
dataReplace
.
get
(
byId
.
getDeptNo
());
}
if
(
null
!=
coverObject
)
{
if
(
Common
.
isNotNull
(
data
)
&&
Common
.
isNotNull
(
data
.
get
(
byId
.
getDeptNo
()))){
coverObject
=
data
.
get
(
byId
.
getDeptNo
());
vo
.
setCoverInvoiceTitle
(
Optional
.
ofNullable
(
coverObject
.
getInvoiceTitleInsurance
()).
orElse
(
""
));
}
else
{
vo
.
setCoverInvoiceTitle
(
"未获取到对应项目信息"
);
}
}
}
//替换人
fromOne
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getFromInsuranceDetailId
,
vo
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
fromOne
).
isPresent
())
{
byId
=
this
.
getById
(
fromOne
.
getToInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
byId
).
isPresent
())
{
vo
.
setReplaceEmpName
(
byId
.
getEmpName
());
vo
.
setReplaceEmpIdcardNo
(
byId
.
getEmpIdcardNo
());
vo
.
setReplaceProjectName
(
byId
.
getDeptName
());
if
(
Common
.
isNotNull
(
data
)
&&
Common
.
isNotNull
(
data
.
get
(
byId
.
getDeptNo
()))){
coverObject
=
data
.
get
(
byId
.
getDeptNo
());
vo
.
setReplaceInvoiceTitle
(
Optional
.
ofNullable
(
coverObject
.
getInvoiceTitleInsurance
()).
orElse
(
""
));
}
else
{
vo
.
setReplaceInvoiceTitle
(
"未获取到对应项目信息"
);
}
}
}
//购买月数
vo
.
setBuyMonth
(
LocalDateUtil
.
betweenMonth
(
vo
.
getPolicyStart
().
toString
(),
vo
.
getPolicyEnd
().
toString
()));
if
(
Objects
.
nonNull
(
data
))
{
ProjectSetInfoVo
jsonObject
=
data
.
get
(
vo
.
getDeptNo
());
if
(
null
!=
jsonObject
)
{
vo
.
setInvoiceTitle
(
Optional
.
ofNullable
(
jsonObject
.
getInvoiceTitleInsurance
()).
orElse
(
""
));
}
if
(
Common
.
isNotNull
(
data
)
&&
Common
.
isNotNull
(
data
.
get
(
vo
.
getDeptNo
())))
{
coverObject
=
data
.
get
(
vo
.
getDeptNo
());
vo
.
setInvoiceTitle
(
Optional
.
ofNullable
(
coverObject
.
getInvoiceTitleInsurance
()).
orElse
(
""
));
}
util
.
convertEntityAsso
(
vo
,
null
,
null
,
null
,
allFields
);
}
...
...
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