Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
e6edd17c
Commit
e6edd17c
authored
Apr 19, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决导入保单时用户名为空
parent
d669820f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
31 deletions
+38
-31
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+28
-23
src/main/java/cn/timer/api/controller/insure/enums/PlanEnum.java
+10
-8
No files found.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
e6edd17c
package
cn
.
timer
.
api
.
controller
.
insure
;
import
cn.timer.api.bean.insure.*
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.controller.insure.enums.
Insurance
Enum
;
import
cn.timer.api.controller.insure.enums.
Plan
Enum
;
import
cn.timer.api.dao.insure.InsureLogMapper
;
import
cn.timer.api.dao.insure.InsurePolicyMapper
;
import
cn.timer.api.dao.insure.InsureUserMapper
;
...
...
@@ -331,7 +330,7 @@ public class InsureContorll {
plansList
.
forEach
(
p
->
{
List
<
YgglMainEmp
>
ygglMainEmpList
=
ygglMainEmpMapper
.
selectListByIds
(
p
.
getUserIds
());
for
(
YgglMainEmp
y
:
ygglMainEmpList
)
{
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
InsuranceEnum
.
getEnum
(
p
.
getBenefitBasicPlan
(),
p
.
getBenefitOccupationCategory
()).
getName
(),
createDate
,
"深圳名邦人力资源管理有限公司"
,
StringUtils
.
isNullOrEmpty
(
p
.
getTricycleFrameNumber
())
?
"无"
:
p
.
getTricycleFrameNumber
(),
Insurance
Enum
.
getEnum
(
p
.
getBenefitBasicPlan
(),
p
.
getBenefitOccupationCategory
()).
getType
()};
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
PlanEnum
.
getEnum
(
p
.
getBenefitBasicPlan
(),
p
.
getBenefitOccupationCategory
()).
getName
(),
createDate
,
"深圳名邦人力资源管理有限公司"
,
StringUtils
.
isNullOrEmpty
(
p
.
getTricycleFrameNumber
())
?
"无"
:
p
.
getTricycleFrameNumber
(),
Plan
Enum
.
getEnum
(
p
.
getBenefitBasicPlan
(),
p
.
getBenefitOccupationCategory
()).
getType
()};
list
.
add
(
arr
);
}
});
...
...
@@ -447,8 +446,8 @@ public class InsureContorll {
InsureUser
.
builder
()
.
transId
(
"IS_"
+
insurePolicy
.
getOrgCode
()
+
"_"
+
dtf2
.
format
(
now
))
.
insuredName
(
qyzxEntInfoM
.
getName
())
.
price
(
String
.
valueOf
(
Insurance
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getPrice
()))
/*前端获取的保费*/
.
premium
(
String
.
valueOf
(
Insurance
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getPrice
()
*
insureDto
.
getUserIds
().
length
))
.
price
(
String
.
valueOf
(
Plan
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getPrice
()))
/*前端获取的保费*/
.
premium
(
String
.
valueOf
(
Plan
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getPrice
()
*
insureDto
.
getUserIds
().
length
))
.
batchNo
(
data
.
get
(
"import_uuid"
).
toString
())
.
benefitBasicPlan
(
insureDto
.
getBenefitBasicPlan
())
.
policyNo
(
orderImportInfo
.
get
(
"contract_no"
).
toString
())
...
...
@@ -496,7 +495,7 @@ public class InsureContorll {
List
<
YgglMainEmp
>
ygglMainEmpList
=
ygglMainEmpMapper
.
selectListByIds
(
insureDto
.
getUserIds
());
List
list
=
Lists
.
newArrayList
();
for
(
YgglMainEmp
y
:
ygglMainEmpList
)
{
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
InsuranceEnum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getName
(),
insureDto
.
getPolicyDateStart
(),
"深圳名邦人力资源管理有限公司"
,
StringUtils
.
isNullOrEmpty
(
insureDto
.
getTricycleFrameNumber
())
?
"无"
:
insureDto
.
getTricycleFrameNumber
(),
Insurance
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getType
()};
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
PlanEnum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getName
(),
insureDto
.
getPolicyDateStart
(),
"深圳名邦人力资源管理有限公司"
,
StringUtils
.
isNullOrEmpty
(
insureDto
.
getTricycleFrameNumber
())
?
"无"
:
insureDto
.
getTricycleFrameNumber
(),
Plan
Enum
.
getEnum
(
insureDto
.
getBenefitBasicPlan
(),
insureDto
.
getBenefitOccupationCategory
()).
getType
()};
list
.
add
(
arr
);
}
String
[]
rowName
=
new
String
[]{
"ID"
,
"name"
,
"ID_type"
,
"ID_number"
,
"Scheme_name"
,
"Date_start"
,
"Branch"
,
"Tricycle_frame_number"
,
"benefit_occupation_category"
};
...
...
@@ -754,41 +753,41 @@ public class InsureContorll {
switch
(
plan
)
{
case
"36968"
:
if
(
type
.
equals
(
"63119"
))
{
return
Insurance
Enum
.
A_30
.
getPrice
();
return
Plan
Enum
.
A_30
.
getPrice
();
}
else
if
(
type
.
equals
(
"63120"
))
{
return
Insurance
Enum
.
B_30
.
getPrice
();
return
Plan
Enum
.
B_30
.
getPrice
();
}
break
;
case
"36969"
:
if
(
type
.
equals
(
"63119"
))
{
return
Insurance
Enum
.
A_30
.
getPrice
();
return
Plan
Enum
.
A_30
.
getPrice
();
}
else
if
(
type
.
equals
(
"63120"
))
{
return
Insurance
Enum
.
B_50
.
getPrice
();
return
Plan
Enum
.
B_50
.
getPrice
();
}
else
if
(
type
.
equals
(
"63121"
))
{
return
Insurance
Enum
.
C_50
.
getPrice
();
return
Plan
Enum
.
C_50
.
getPrice
();
}
break
;
case
"36970"
:
if
(
type
.
equals
(
"63119"
))
{
return
Insurance
Enum
.
A_80
.
getPrice
();
return
Plan
Enum
.
A_80
.
getPrice
();
}
else
if
(
type
.
equals
(
"63120"
))
{
return
Insurance
Enum
.
B_80
.
getPrice
();
return
Plan
Enum
.
B_80
.
getPrice
();
}
else
if
(
type
.
equals
(
"63121"
))
{
return
Insurance
Enum
.
C_80
.
getPrice
();
return
Plan
Enum
.
C_80
.
getPrice
();
}
break
;
case
"36971"
:
if
(
type
.
equals
(
"63119"
))
{
return
Insurance
Enum
.
A_80_20
.
getPrice
();
return
Plan
Enum
.
A_80_20
.
getPrice
();
}
else
if
(
type
.
equals
(
"63120"
))
{
return
Insurance
Enum
.
B_80_20
.
getPrice
();
return
Plan
Enum
.
B_80_20
.
getPrice
();
}
break
;
case
"36972"
:
if
(
type
.
equals
(
"63119"
))
{
return
Insurance
Enum
.
A_100
.
getPrice
();
return
Plan
Enum
.
A_100
.
getPrice
();
}
else
if
(
type
.
equals
(
"63120"
))
{
return
Insurance
Enum
.
B_100
.
getPrice
();
return
Plan
Enum
.
B_100
.
getPrice
();
}
break
;
}
...
...
@@ -1010,8 +1009,11 @@ public class InsureContorll {
}
break
;
case
"方案名称"
:
PlanEnum
plan
=
PlanEnum
.
getEnumOfName
(
ExcelUtils
.
getString
(
cell
).
trim
());
user
.
setBenefitBasicPlan
(
plan
.
getType
());
user
.
setBenefitOccupationCategory
(
plan
.
getCategory
());
break
;
case
"有效
时间
"
:
case
"有效
期起
"
:
Date
start
=
null
;
try
{
start
=
dtf3
.
parse
(
ExcelUtils
.
getString
(
cell
));
...
...
@@ -1028,8 +1030,8 @@ public class InsureContorll {
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
user
.
setPolicyDate
Start
(
end
);
policy
.
setPolicyDate
Start
(
end
);
user
.
setPolicyDate
End
(
end
);
policy
.
setPolicyDate
End
(
end
);
break
;
case
"被保险人姓名"
:
user
.
setInsuredEContact
(
ExcelUtils
.
getString
(
cell
));
...
...
@@ -1060,9 +1062,10 @@ public class InsureContorll {
return
ResultUtil
.
error
(
"企业不存在"
);
}
user
.
setOrgCode
(
company
.
getId
());
policy
.
setOrgCode
(
company
.
getId
());
break
;
case
"总保费"
:
user
.
setPrice
(
ExcelUtils
.
getString
(
cell
)
);
user
.
setPrice
(
Integer
.
parseInt
(
ExcelUtils
.
getString
(
cell
))+
""
);
break
;
}
}
...
...
@@ -1070,6 +1073,7 @@ public class InsureContorll {
}
InsurePolicy
oldPolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getPolicyNo
,
policy
.
getPolicyNo
()));
if
(
oldPolicy
==
null
)
{
policy
.
setSchemeName
(
InsureProduct
.
builder
().
id
(
1
).
build
().
selectById
().
getName
());
policy
.
insert
();
}
else
{
policy
=
oldPolicy
;
...
...
@@ -1087,12 +1091,13 @@ public class InsureContorll {
ygglMainEmp
.
setIsInsure
(
1
);
}
else
{
/*如果不存在员工就创建一名员工*/
ygglMainEmp
.
builder
().
build
();
ygglMainEmp
=
new
YgglMainEmp
();
ygglMainEmp
.
setName
(
insureUser
.
getInsuredEContact
());
ygglMainEmp
.
setZjType
(
0
);
ygglMainEmp
.
setZjNum
(
insureUser
.
getInsuredNo
());
ygglMainEmp
.
setOrgCode
(
insureUser
.
getOrgCode
());
}
insureUser
.
setPolicyId
(
policy
.
getId
());
ygglMainEmp
.
insertOrUpdate
();
insureUser
.
insert
();
...
...
src/main/java/cn/timer/api/controller/insure/enums/
Insurance
Enum.java
→
src/main/java/cn/timer/api/controller/insure/enums/
Plan
Enum.java
View file @
e6edd17c
package
cn
.
timer
.
api
.
controller
.
insure
.
enums
;
import
io.swagger.models.auth.In
;
import
lombok.Data
;
import
cn.timer.api.utils.ExcelUtils
;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/24 17:20
*/
public
enum
Insurance
Enum
{
public
enum
Plan
Enum
{
A_30
(
12
,
"30万意外/3万医疗/扩展24小时(A类)"
,
"A类"
,
"36968"
,
"63119"
),
A_50
(
15
,
"50万意外/5万医疗/扩展24小时(A类)"
,
"A类"
,
"36969"
,
"63119"
),
A_80
(
18
,
"80万意外/10万医疗/扩展24小时(A类)"
,
"A类"
,
"36970"
,
"63119"
),
...
...
@@ -27,7 +26,7 @@ public enum InsuranceEnum {
private
String
plan
;
private
String
category
;
InsuranceEnum
(
Integer
price
,
String
name
,
String
type
,
String
plan
,
String
category
)
{
PlanEnum
(
Integer
price
,
String
name
,
String
type
,
String
plan
,
String
category
)
{
this
.
price
=
price
;
this
.
name
=
name
;
this
.
type
=
type
;
...
...
@@ -75,11 +74,14 @@ public enum InsuranceEnum {
this
.
category
=
category
;
}
public
static
InsuranceEnum
getEnum
(
String
plan
,
String
category
)
{
for
(
Insurance
Enum
v
:
values
())
public
static
PlanEnum
getEnum
(
String
plan
,
String
category
)
{
for
(
Plan
Enum
v
:
values
())
if
(
v
.
getPlan
().
equals
(
plan
)&&
v
.
getCategory
().
equals
(
category
))
return
v
;
throw
new
IllegalArgumentException
();
}
public
static
PlanEnum
getEnumOfName
(
String
name
){
for
(
PlanEnum
v
:
values
())
if
(
v
.
getName
().
equals
(
name
))
return
v
;
throw
new
IllegalArgumentException
();
}
}
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