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
6b523c3f
Commit
6b523c3f
authored
Aug 23, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险办理导入接口
parent
4fa52c95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
8 deletions
+68
-8
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+0
-4
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+1
-1
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+67
-3
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
6b523c3f
...
@@ -868,10 +868,6 @@ public class InsurancesConstants {
...
@@ -868,10 +868,6 @@ public class InsurancesConstants {
* 当前为投保中状态,不可办理
* 当前为投保中状态,不可办理
*/
*/
public
static
final
String
BUY_HANDLE_STATUS_TWO_HANDLE_ERROR
=
"当前为投保中状态,不可办理"
;
public
static
final
String
BUY_HANDLE_STATUS_TWO_HANDLE_ERROR
=
"当前为投保中状态,不可办理"
;
/**
* 当前为非投保中状态,不可办理
*/
public
static
final
String
BUY_HANDLE_STATUS_NOT_TWO_HANDLE_ERROR
=
"当前为非投保中状态,不可办理"
;
/**
/**
* 当前为已投保状态,不可办理
* 当前为已投保状态,不可办理
*/
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
6b523c3f
...
@@ -253,7 +253,7 @@ public class TInsuranceDetailController {
...
@@ -253,7 +253,7 @@ public class TInsuranceDetailController {
*/
*/
@Operation
(
summary
=
"投保成功/退回办理导入"
,
description
=
"投保成功/退回办理导入"
)
@Operation
(
summary
=
"投保成功/退回办理导入"
,
description
=
"投保成功/退回办理导入"
)
@PostMapping
(
"/insuranceHandleImport"
)
@PostMapping
(
"/insuranceHandleImport"
)
public
R
<
List
<
InsuranceHandleImportParam
>>
insuranceHandleImport
(
@RequestBody
List
<
InsuranceHandleImportParam
>
param
)
{
public
R
<
List
<
InsuranceHandleImportParam
>>
insuranceHandleImport
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
InsuranceHandleImportParam
>
param
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
6b523c3f
...
@@ -1084,9 +1084,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1084,9 +1084,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
@Override
public
R
<
List
<
InsuranceHandleImportParam
>>
insuranceHandleImport
(
YifuUser
user
,
List
<
InsuranceHandleImportParam
>
param
)
{
public
R
<
List
<
InsuranceHandleImportParam
>>
insuranceHandleImport
(
YifuUser
user
,
List
<
InsuranceHandleImportParam
>
param
)
{
Map
<
String
,
List
<
InsuranceHandleImportParam
>>
map
=
insuranceChangeCheck
(
param
,
user
,
false
);
Map
<
String
,
List
<
InsuranceHandleImportParam
>>
map
=
insuranceChangeCheck
(
param
,
user
,
false
);
//检验成功的数据
List
<
InsuranceHandleImportParam
>
successList
=
map
.
get
(
"successList"
);
List
<
InsuranceHandleImportParam
>
successList
=
map
.
get
(
"successList"
);
//校验失败的数据
List
<
InsuranceHandleImportParam
>
errorList
=
map
.
get
(
"errorList"
);
List
<
InsuranceHandleImportParam
>
errorList
=
map
.
get
(
"errorList"
);
return
R
.
ok
(
errorList
,
InsurancesConstants
.
ADD_SUCCESS
);
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
//投保成功的数据
List
<
InsuranceHandleImportParam
>
collectSuccess
=
successList
.
stream
().
filter
(
e
->
InsurancesConstants
.
SUCCESS
.
equals
(
e
.
getHandType
())).
collect
(
Collectors
.
toList
());
//投保退回的数据
List
<
InsuranceHandleImportParam
>
collectRollBack
=
successList
.
stream
().
filter
(
e
->
InsurancesConstants
.
FAILED
.
equals
(
e
.
getHandType
())).
collect
(
Collectors
.
toList
());
//投保成功
if
(
CollectionUtils
.
isNotEmpty
(
collectSuccess
)){
List
<
InsuranceHandleParam
>
list
=
new
ArrayList
<>();
collectSuccess
.
stream
().
forEach
(
e
->{
InsuranceHandleParam
handleParam
=
new
InsuranceHandleParam
();
handleParam
.
setId
(
e
.
getId
());
handleParam
.
setRemark
(
e
.
getRemark
());
list
.
add
(
handleParam
);
});
this
.
successfulInsurance
(
user
,
list
);
}
//投保退回
if
(
CollectionUtils
.
isNotEmpty
(
collectRollBack
)){
List
<
InsuranceHandleParam
>
list
=
new
ArrayList
<>();
collectRollBack
.
stream
().
forEach
(
e
->{
InsuranceHandleParam
handleParam
=
new
InsuranceHandleParam
();
handleParam
.
setId
(
e
.
getId
());
handleParam
.
setRemark
(
e
.
getRemark
());
list
.
add
(
handleParam
);
});
this
.
rollBackInsurance
(
user
,
list
);
}
}
return
R
.
ok
(
errorList
,
InsurancesConstants
.
IMPORT_SUCCESS
);
}
}
/**
/**
...
@@ -3244,7 +3276,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3244,7 +3276,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
tInsuranceOperateService
.
saveBatch
(
operateList
);
tInsuranceOperateService
.
saveBatch
(
operateList
);
return
R
.
ok
(
errorList
,
"导入成功"
);
return
R
.
ok
(
errorList
,
InsurancesConstants
.
IMPORT_SUCCESS
);
}
}
/**
/**
...
@@ -4469,7 +4501,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -4469,7 +4501,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保成功/退回办理
//投保成功/退回办理
//商险不是投保中,无法办理
//商险不是投保中,无法办理
if
(
CommonConstants
.
TWO_INT
!=
insuranceDetail
.
getBuyHandleStatus
()){
if
(
CommonConstants
.
TWO_INT
!=
insuranceDetail
.
getBuyHandleStatus
()){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_HANDLE_STATUS_NOT_TWO_HANDLE_ERROR
);
String
buyHandleStatus
=
getBuyHandleStatus
(
insuranceDetail
.
getBuyHandleStatus
());
param
.
setErrorMessage
(
"当前为"
+
buyHandleStatus
+
"状态,不可办理"
);
errorList
.
add
(
param
);
errorList
.
add
(
param
);
continue
;
continue
;
}
}
...
@@ -4482,6 +4515,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -4482,6 +4515,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
map
;
return
map
;
}
}
/**
* 获取投保状态的值
*
* @author licancan
* @param buyHandleStatus
* @return {@link String}
*/
private
String
getBuyHandleStatus
(
Integer
buyHandleStatus
){
String
result
;
switch
(
buyHandleStatus
){
case
1
:
result
=
"待投保"
;
break
;
case
2
:
result
=
"投保中"
;
break
;
case
3
:
result
=
"已投保"
;
break
;
case
4
:
result
=
"投保退回"
;
break
;
case
5
:
result
=
"已减员"
;
break
;
default
:
result
=
""
;
}
return
result
;
}
/**
/**
* 校验所属项目
* 校验所属项目
*
*
...
...
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