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
13ba8374
Commit
13ba8374
authored
2 years ago
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入被保人员bug修复
parent
2438b968
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
3 deletions
+39
-3
sql/insure_policy.sql
+3
-0
src/main/java/cn/timer/api/bean/insure/InsureUser.java
+2
-0
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+26
-3
src/main/java/cn/timer/api/dto/insure/InsureDto.java
+4
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+3
-0
src/main/resources/mapping/insure/InsureUserMapper.xml
+1
-0
No files found.
sql/insure_policy.sql
View file @
13ba8374
...
@@ -167,3 +167,6 @@ SET FOREIGN_KEY_CHECKS = 1;
...
@@ -167,3 +167,6 @@ SET FOREIGN_KEY_CHECKS = 1;
INSERT
INTO
`timer_test`
.
`admin_menu_template`
(
`id`
,
`parentId`
,
`menu_code`
,
`menu_name`
,
`sort_number`
,
`path`
,
`enable`
,
`distribution`
)
VALUES
(
23
,
0
,
'policy'
,
'保单管理'
,
23
,
'/policy'
,
1
,
1
);
INSERT
INTO
`timer_test`
.
`admin_menu_template`
(
`id`
,
`parentId`
,
`menu_code`
,
`menu_name`
,
`sort_number`
,
`path`
,
`enable`
,
`distribution`
)
VALUES
(
23
,
0
,
'policy'
,
'保单管理'
,
23
,
'/policy'
,
1
,
1
);
INSERT
INTO
`timer_test`
.
`qyzx_admin_menu`
(
`id`
,
`menu_code`
,
`menu_name`
,
`sort_number`
,
`org_code`
,
`addtime`
)
VALUES
(
364
,
'policy'
,
'保单管理'
,
17
,
1
,
1648712195019
);
INSERT
INTO
`timer_test`
.
`qyzx_admin_menu`
(
`id`
,
`menu_code`
,
`menu_name`
,
`sort_number`
,
`org_code`
,
`addtime`
)
VALUES
(
364
,
'policy'
,
'保单管理'
,
17
,
1
,
1648712195019
);
ALTER
TABLE
`timer_test`
.
`insure_user`
ADD
COLUMN
`reason`
varchar
(
255
)
NULL
COMMENT
'批改原因'
AFTER
`apply_type`
;
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/bean/insure/InsureUser.java
View file @
13ba8374
...
@@ -155,5 +155,7 @@ public class InsureUser extends Model<InsureUser> {
...
@@ -155,5 +155,7 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty
(
value
=
"申请类型:1新增 2投保 3批增"
)
@ApiModelProperty
(
value
=
"申请类型:1新增 2投保 3批增"
)
private
Integer
applyType
;
private
Integer
applyType
;
@ApiModelProperty
(
value
=
"批改原因"
)
private
String
reason
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
13ba8374
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.beust.jcommander.internal.Lists
;
import
com.beust.jcommander.internal.Lists
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.JsonObject
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
...
@@ -589,6 +590,22 @@ public class InsureContorll {
...
@@ -589,6 +590,22 @@ public class InsureContorll {
if
(
insurePolicy
==
null
)
{
if
(
insurePolicy
==
null
)
{
return
ResultUtil
.
error
(
"保单不存在"
);
return
ResultUtil
.
error
(
"保单不存在"
);
}
}
/*单个替换*/
if
(
insureDto
.
getLimit
()==
1
){
if
(!
StringUtils
.
isNullOrEmpty
(
insureDto
.
getUserName
())&&!
StringUtils
.
isNullOrEmpty
(
insureDto
.
getIdCardNo
())){
YgglMainEmp
y
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
()
.
eq
(
YgglMainEmp:
:
getName
,
insureDto
.
getUserName
()).
eq
(
YgglMainEmp:
:
getZjNum
,
insureDto
.
getIdCardNo
()));
if
(
y
==
null
){
y
=
new
YgglMainEmp
();
y
.
setName
(
insureDto
.
getUserName
());
y
.
setZjType
(
0
);
y
.
setZjNum
(
insureDto
.
getIdCardNo
());
y
.
setOrgCode
(
Integer
.
parseInt
(
insureDto
.
getOrgCode
()));
y
.
insert
();
}
insureDto
.
setUserIds
(
new
String
[]{
String
.
valueOf
(
y
.
getId
())});
}
}
List
<
InsureUser
>
oldInsureUserList
=
insureUserMapper
.
selectListByIds
(
insureDto
.
getOldIds
());
List
<
InsureUser
>
oldInsureUserList
=
insureUserMapper
.
selectListByIds
(
insureDto
.
getOldIds
());
String
[]
oldUser
=
new
String
[
oldInsureUserList
.
size
()];
String
[]
oldUser
=
new
String
[
oldInsureUserList
.
size
()];
for
(
int
i
=
0
;
i
<
oldInsureUserList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
oldInsureUserList
.
size
();
i
++)
{
...
@@ -879,6 +896,7 @@ public class InsureContorll {
...
@@ -879,6 +896,7 @@ public class InsureContorll {
}
}
List
<
YgglMainEmp
>
yg
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
yg
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
selectUserList
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
selectUserList
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
allList
=
Lists
.
newArrayList
();
try
{
try
{
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
...
@@ -951,7 +969,8 @@ public class InsureContorll {
...
@@ -951,7 +969,8 @@ public class InsureContorll {
if
(
newList
.
size
()
>
0
)
{
if
(
newList
.
size
()
>
0
)
{
newList
.
forEach
(
u
->
u
.
insert
());
newList
.
forEach
(
u
->
u
.
insert
());
}
}
selectUserList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
()).
stream
().
filter
(
s
->
s
.
getIsInsure
()==
0
).
collect
(
Collectors
.
toList
());
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
selectUserList
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()==
0
).
collect
(
Collectors
.
toList
());
//假期规则初始化
//假期规则初始化
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
orgCode
));
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
orgCode
));
...
@@ -959,8 +978,12 @@ public class InsureContorll {
...
@@ -959,8 +978,12 @@ public class InsureContorll {
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
ResultUtil
.
data
(
selectUserList
,
selectUserList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()==
1
).
map
(
YgglMainEmp:
:
getName
).
collect
(
Collectors
.
toList
()).
toString
()+
"已投过保"
);
List
<
String
>
message
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()==
1
).
map
(
YgglMainEmp:
:
getName
).
collect
(
Collectors
.
toList
());
}
if
(
message
.
size
()>
0
){
return
ResultUtil
.
data
(
selectUserList
,
JSONObject
.
toJSONString
(
message
)+
"已投过保"
);
}
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
}
@PostMapping
(
value
=
"/importPolicy"
)
@PostMapping
(
value
=
"/importPolicy"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dto/insure/InsureDto.java
View file @
13ba8374
...
@@ -34,6 +34,10 @@ public class InsureDto {
...
@@ -34,6 +34,10 @@ public class InsureDto {
private
String
[]
userIds
;
private
String
[]
userIds
;
private
Double
totalPrice
;
private
Double
totalPrice
;
private
MultipartFile
file
;
private
MultipartFile
file
;
private
Integer
limit
=
0
;
/*代表是单独替换*/
private
String
userName
;
private
String
idCardNo
;
private
String
reason
;
/*批改原因*/
// private String
// private String
}
}
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
13ba8374
...
@@ -276,6 +276,9 @@
...
@@ -276,6 +276,9 @@
select count(ip.id)
select count(ip.id)
from insure_policy ip
from insure_policy ip
<where>
<where>
<if
test=
"policy.productId!=null and policy.productId!=''"
>
and ip.product_id = #{policy.productId}
</if>
<if
test=
"policy.status!=null and policy.status!=''"
>
<if
test=
"policy.status!=null and policy.status!=''"
>
and ip.status = #{policy.status}
and ip.status = #{policy.status}
</if>
</if>
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
13ba8374
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
<result
property=
"policyId"
column=
"policy_id"
/>
<result
property=
"policyId"
column=
"policy_id"
/>
<result
property=
"replaceTransId"
column=
"replace_trans_id"
/>
<result
property=
"replaceTransId"
column=
"replace_trans_id"
/>
<result
property=
"applyType"
column=
"apply_type"
/>
<result
property=
"applyType"
column=
"apply_type"
/>
<result
property=
"reason"
column=
"reason"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureUser"
>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureUser"
>
...
...
This diff is collapsed.
Click to expand it.
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