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
2433731b
Commit
2433731b
authored
Sep 03, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保单号维护表分页-fxj
parent
d610e8e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
TInsurancePolicyServiceImpl.java
...s/service/insurance/impl/TInsurancePolicyServiceImpl.java
+12
-12
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsurancePolicyServiceImpl.java
View file @
2433731b
...
@@ -213,6 +213,10 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
...
@@ -213,6 +213,10 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
InsurancePolicyImportVo
>
util1
=
new
ExcelUtil
<>(
InsurancePolicyImportVo
.
class
);
ExcelUtil
<
InsurancePolicyImportVo
>
util1
=
new
ExcelUtil
<>(
InsurancePolicyImportVo
.
class
);
Map
<
String
,
String
>
policyNoMap
=
new
HashMap
<>();
Map
<
String
,
String
>
policyNoMap
=
new
HashMap
<>();
// 获取所有的保险公司
Map
<
String
,
TInsuranceCompany
>
companyMap
=
getCompanyMap
();
// 获取所有险种
Map
<
String
,
TInsuranceType
>
typeMap
=
getTypeMap
();
// 匿名内部类 不用额外写一个DemoDataListener
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try
{
try
{
...
@@ -255,7 +259,7 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
...
@@ -255,7 +259,7 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
*/
*/
private
void
saveData
()
{
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importInsurancePolicy
(
cachedDataList
,
errorMessageList
,
user
,
policyNoMap
);
importInsurancePolicy
(
cachedDataList
,
errorMessageList
,
user
,
policyNoMap
,
companyMap
,
typeMap
);
log
.
info
(
"存储数据库成功!"
);
log
.
info
(
"存储数据库成功!"
);
}
}
}).
sheet
().
doRead
();
}).
sheet
().
doRead
();
...
@@ -264,21 +268,20 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
...
@@ -264,21 +268,20 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
finally
{
}
finally
{
Common
.
clear
(
policyNoMap
);
Common
.
clear
(
policyNoMap
);
Common
.
clear
(
companyMap
);
Common
.
clear
(
typeMap
);
}
}
return
Common
.
judgeAllMessage
(
errorMessageList
);
return
Common
.
judgeAllMessage
(
errorMessageList
);
}
}
public
void
importInsurancePolicy
(
List
<
InsurancePolicyImportVo
>
excelVOList
,
public
void
importInsurancePolicy
(
List
<
InsurancePolicyImportVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
,
List
<
ErrorMessage
>
errorMessageList
,
YifuUser
user
,
Map
<
String
,
String
>
policyNoMap
)
{
YifuUser
user
,
Map
<
String
,
String
>
policyNoMap
,
Map
<
String
,
TInsuranceCompany
>
companyMap
,
Map
<
String
,
TInsuranceType
>
typeMap
)
{
if
(!
Common
.
isNotNull
(
excelVOList
))
{
if
(!
Common
.
isNotNull
(
excelVOList
))
{
return
;
return
;
}
}
Map
<
String
,
String
>
excelVOTemp
=
new
HashMap
<>();
// 获取所有的保险公司
Map
<
String
,
TInsuranceCompany
>
companyMap
=
getCompanyMap
();
// 获取所有险种
Map
<
String
,
TInsuranceType
>
typeMap
=
getTypeMap
();
//获取本次导入对应的保单号是否已经存在
//获取本次导入对应的保单号是否已经存在
Map
<
String
,
String
>
existMap
=
getExistMap
(
excelVOList
);
Map
<
String
,
String
>
existMap
=
getExistMap
(
excelVOList
);
InsurancePolicyImportVo
excel
=
null
;
InsurancePolicyImportVo
excel
=
null
;
...
@@ -341,12 +344,9 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
...
@@ -341,12 +344,9 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
tBusinessOperateService
.
save
(
operate
);
tBusinessOperateService
.
save
(
operate
);
policyNoMap
.
put
(
excel
.
getPolicyNo
(),
excel
.
getRowIndex
().
toString
());
policyNoMap
.
put
(
excel
.
getPolicyNo
(),
excel
.
getRowIndex
().
toString
());
// 清理map list 等数据
Common
.
clear
(
excelVOList
);
Common
.
clear
(
companyMap
);
Common
.
clear
(
typeMap
);
Common
.
clear
(
excelVOTemp
);
}
}
// 清理map list 等数据
Common
.
clear
(
excelVOList
);
}
}
private
Map
<
String
,
String
>
getExistMap
(
List
<
InsurancePolicyImportVo
>
excelVOList
)
{
private
Map
<
String
,
String
>
getExistMap
(
List
<
InsurancePolicyImportVo
>
excelVOList
)
{
...
...
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