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
76fe946e
Commit
76fe946e
authored
Aug 22, 2022
by
zhaji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"feature-zhaJi:新增减员办理导入接口"
parent
a29573d3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
421 additions
and
45 deletions
+421
-45
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+99
-3
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+1
-1
EKPUtil.java
.../com/yifu/cloud/plus/v1/yifu/insurances/util/EKPUtil.java
+6
-9
InsuranceRefundImportParam.java
...lus/v1/yifu/insurances/vo/InsuranceRefundImportParam.java
+51
-2
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+13
-0
TInsuranceDetailService.java
...s/v1/yifu/insurances/service/TInsuranceDetailService.java
+10
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+241
-30
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
76fe946e
...
...
@@ -505,6 +505,11 @@ public class InsurancesConstants {
*/
public
static
final
String
SETTLE_MONTH_CHANGE_LIST_IS_EMPTY
=
"当前变更结算月列表为空"
;
/**
* 减员办理导入列表为空
*/
public
static
final
String
INSURANCE_REFUND_IMPORT_LIST_IS_EMPTY
=
"减员办理导入列表为空"
;
/**
* 替换类型无法变更项目
*/
...
...
@@ -684,12 +689,12 @@ public class InsurancesConstants {
/**
* 导入减员数据
*/
public
static
final
String
INSURANCE_REFUND_IMPORT
=
"
导入减员数据
"
;
public
static
final
String
INSURANCE_REFUND_IMPORT
=
"
减员提交申请
"
;
/**
* 减员导出办理
*/
public
static
final
String
INSURANCE_REFUND_EXPORT
=
"减员
导出办理
"
;
public
static
final
String
INSURANCE_REFUND_EXPORT
=
"减员
办理中
"
;
/**
* 减员办理成功
...
...
@@ -700,7 +705,7 @@ public class InsurancesConstants {
/**
* 减员退回成功
*/
public
static
final
String
INSURANCE_REFUND_FAILED
=
"减员退回"
;
public
static
final
String
INSURANCE_REFUND_FAILED
=
"减员
办理
退回"
;
/**
* 变更所属项目
...
...
@@ -794,5 +799,96 @@ public class InsurancesConstants {
*/
public
static
final
String
INSURANCES_DETAIL_IS_OVERDUE_ERROR
=
"保单信息已过期,不能进行出险操作"
;
/**
* 当前的操作类型不正确
*/
/**
* 减员办理列表为空
*/
/**
* 减员退回的办理意见不能为空
*/
public
static
final
String
REFUND_MESSAGE_IS_EMPTY
=
"减员退回的办理意见不能为空"
;
/**
* 该保单信息已被更新为减员退回
*/
/**
* 该保单信息已被更新为减员成功
*/
/**
* 该保单信息已被删除
*/
public
static
final
String
INSURANCES_IS_DELETE
=
"该保单信息已被删除"
;
/**
* 导入成功
*/
public
static
final
String
IMPORT_SUCCESS
=
"导入成功"
;
/**
* 成功
*/
public
static
final
String
SUCCESS
=
"成功"
;
/**
* 失败
*/
public
static
final
String
FAILED
=
"失败"
;
/**
* 办理结果类型错误
*/
public
static
final
String
HAND_RESULT_ERROR
=
"办理结果类型错误"
;
/**
* 办理结果为空
*/
public
static
final
String
HAND_RESULT_IS_EMPTY
=
"办理结果为空"
;
/**
* 无该条数据的操作权限
*/
public
static
final
String
NO_DETAIL_JURISDICTION
=
"无该条数据的操作权限"
;
/**
* 当前为待投保状态,不可办理
*/
public
static
final
String
BUY_HANDLE_STATUS_ONE_HANDLE_ERROR
=
"当前为待投保状态,不可办理"
;
/**
* 当前为投保中状态,不可办理
*/
public
static
final
String
BUY_HANDLE_STATUS_TWO_HANDLE_ERROR
=
"当前为投保中状态,不可办理"
;
/**
* 当前为已投保状态,不可办理
*/
public
static
final
String
BUY_HANDLE_STATUS_THREE_HANDLE_ERROR
=
"当前为已投保状态,不可办理"
;
/**
* 当前为投保退回状态,不可办理
*/
public
static
final
String
BUY_HANDLE_STATUS_FOUR_HANDLE_ERROR
=
"当前为投保退回状态,不可办理"
;
/**
* 当前为待减员状态,不可办理
*/
public
static
final
String
REFUND_STATUS_ONE_HANDLE_ERROR
=
"当前为待减员状态,不可办理"
;
/**
* 当前为已减员状态,不可办理
*/
public
static
final
String
REFUND_STATUS_THREE_HANDLE_ERROR
=
"当前为已减员状态,不可办理"
;
/**
* 当前为减员退回状态,不可办理
*/
public
static
final
String
REFUND_STATUS_FOUR_HANDLE_ERROR
=
"当前为减员退回状态,不可办理"
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
76fe946e
...
...
@@ -238,7 +238,7 @@ public class TInsuranceDetail extends BaseEntity {
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema
(
description
=
"减员状态 1待减员 2减员中3减员退回"
)
@Schema
(
description
=
"减员状态 1待减员 2减员中3减员退回
,4减员成功
"
)
private
Integer
reduceHandleStatus
;
/**
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/EKPUtil.java
View file @
76fe946e
...
...
@@ -83,7 +83,7 @@ public class EKPUtil {
* 注意key的书写格式,类似EL表达式的方式,属性关系用'.', 列表和数组关系用[],Map关系用["xxx"]
*/
public
static
String
sendToEKP
(
EKPInteractiveParam
param
){
System
.
out
.
println
(
"开始推送EKP
"
);
log
.
info
(
"推送EKP开始
"
);
RestTemplate
yourRestTemplate
=
new
RestTemplate
();
TInsuranceSettlePushParam
pushParam
=
InsuranceDetail2PushParam
(
param
);
try
{
...
...
@@ -112,21 +112,18 @@ public class EKPUtil {
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
entity
=
new
HttpEntity
<
MultiValueMap
<
String
,
Object
>>(
wholeForm
,
headers
);
//有返回值的情况 VO可以替换成具体的JavaBean
System
.
out
.
println
(
"交易开始"
);
ResponseEntity
<
String
>
obj
=
yourRestTemplate
.
exchange
(
url
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
System
.
out
.
println
(
"交易结束"
);
System
.
out
.
println
(
"obj"
+
obj
);
String
body
=
obj
.
getBody
();
if
(
StringUtils
.
isBlank
(
body
)){
System
.
out
.
println
(
"交易失败"
+
body
);
return
body
;
log
.
error
(
"交易失败"
);
return
null
;
}
else
{
System
.
out
.
println
(
"交易成功
"
+
body
);
log
.
info
(
"交易成功:
"
+
body
);
return
body
;
}
}
catch
(
Exception
e
){
log
.
info
(
e
.
toString
());
return
e
.
getMessage
()
;
log
.
info
(
e
.
getMessage
());
return
null
;
}
}
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceRefundImportParam.java
View file @
76fe946e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
...
...
@@ -24,9 +22,60 @@ public class InsuranceRefundImportParam implements Serializable {
@Schema
(
description
=
"商险id"
)
private
String
id
;
/**
* 员工姓名
*/
@Schema
(
description
=
"员工姓名"
)
private
String
empName
;
/**
* 员工身份证号码
*/
@Schema
(
description
=
"员工身份证号码"
)
private
String
empIdcardNo
;
/**
* 保险公司名称
*/
@Schema
(
description
=
"保险公司名称"
)
private
String
insuranceCompanyName
;
/**
* 险种名称
*/
@Schema
(
description
=
"险种名称"
)
private
String
insuranceTypeName
;
/**
* 保单开始日期
*/
@Schema
(
description
=
"保单开始日期"
)
private
String
policyStart
;
/**
* 保单结束日期
*/
@Schema
(
description
=
"保单结束日期"
)
private
String
policyEnd
;
/**
* 购买标准
*/
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 办理类型
*/
@Schema
(
description
=
"办理类型"
)
private
String
handType
;
/**
* 办理意见
*/
@Schema
(
description
=
"办理意见"
)
private
String
remark
;
/**
* 错误信息
*/
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
76fe946e
...
...
@@ -381,6 +381,19 @@ public class TInsuranceDetailController {
return
tInsuranceDetailService
.
updateInsuranceRefund
(
insuranceDetail
);
}
/**
* 减员办理导入
*
* @author zhaji
* @param insuranceRefundImportList 减员信息
* @return {@link R<List<InsuranceRefundImportParam>>}
*/
@Operation
(
summary
=
"减员办理导入"
,
description
=
"减员办理导入"
)
@PostMapping
(
"/insuranceRefundImport"
)
public
R
insuranceRefundImport
(
@RequestBody
List
<
InsuranceRefundImportParam
>
insuranceRefundImportList
)
{
return
tInsuranceDetailService
.
insuranceRefundImport
(
insuranceRefundImportList
);
}
/**
* 根据保险公司名称查询保单明细
*
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
View file @
76fe946e
...
...
@@ -242,6 +242,16 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
R
updateInsuranceRefund
(
InsuranceRefundListParam
insuranceDetail
);
/**
* 减员办理导入
*
* @author zhaji
* @param insuranceRefundImportList 减员办理导入
* @return {@link R}
*/
R
insuranceRefundImport
(
List
<
InsuranceRefundImportParam
>
insuranceRefundImportList
);
/**
* 变更结算月
*
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
76fe946e
...
...
@@ -3028,7 +3028,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
refund
.
setReduceHandleStatus
(
refundType
);
refundList
.
add
(
refund
);
}
else
{
refundErrorVo
.
setErrorMessage
(
"该保单信息已被删除"
);
refundErrorVo
.
setErrorMessage
(
InsurancesConstants
.
INSURANCES_IS_DELETE
);
errorList
.
add
(
refundErrorVo
);
}
}
...
...
@@ -3043,7 +3043,62 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
else
{
addOperate
(
successList
,
user
,
InsurancesConstants
.
INSURANCE_REFUND_FAILED
,
remark
);
}
return
R
.
ok
(
errorList
,
"操作成功"
);
return
R
.
ok
(
errorList
,
InsurancesConstants
.
OPERATE_SUCCESS
);
}
/**
* 减员办理导入
*
* @author zhaji
* @param
* @return void
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
R
insuranceRefundImport
(
List
<
InsuranceRefundImportParam
>
insuranceRefundImportList
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(!
Common
.
isNotEmpty
(
insuranceRefundImportList
))
{
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_REFUND_IMPORT_LIST_IS_EMPTY
);
}
Map
<
String
,
List
<
InsuranceRefundImportParam
>>
map
=
insuranceChangeCheck
(
insuranceRefundImportList
,
user
);
List
<
InsuranceRefundImportParam
>
successList
=
map
.
get
(
"successList"
);
List
<
InsuranceRefundImportParam
>
errorList
=
map
.
get
(
"errorList"
);
//减员退回
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>(
16
);
if
(
CollectionUtils
.
isNotEmpty
(
successList
))
{
for
(
InsuranceRefundImportParam
param
:
successList
)
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
LambdaUpdateWrapper
<
TInsuranceRefund
>
refund
=
new
LambdaUpdateWrapper
<>();
refund
.
eq
(
TInsuranceRefund
::
getInsDetailId
,
param
.
getId
());
refund
.
set
(
TInsuranceRefund
::
getRemark
,
param
.
getRemark
());
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TInsuranceDetail:
:
getId
,
param
.
getId
())
.
set
(
TInsuranceDetail:
:
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail:
:
getUpdateTime
,
LocalDateTime
.
now
());
if
(
InsurancesConstants
.
SUCCESS
.
equals
(
param
.
getHandType
())){
updateWrapper
.
set
(
TInsuranceDetail
::
getReduceHandleStatus
,
CommonConstants
.
FOUR_INT
);
updateWrapper
.
set
(
TInsuranceDetail
::
getBuyHandleStatus
,
CommonConstants
.
FIVE_INT
);
refund
.
set
(
TInsuranceRefund
::
getReduceHandleStatus
,
CommonConstants
.
FOUR_INT
);
}
else
{
updateWrapper
.
set
(
TInsuranceDetail:
:
getReduceHandleStatus
,
CommonConstants
.
THREE_INT
);
refund
.
set
(
TInsuranceRefund
::
getReduceHandleStatus
,
CommonConstants
.
THREE_INT
);
}
update
(
updateWrapper
);
tInsuranceRefundService
.
update
(
refund
);
operate
.
setInsuranceDetailId
(
param
.
getId
());
operate
.
setRemark
(
param
.
getRemark
());
operate
.
setCreateName
(
user
.
getNickname
());
operate
.
setCreateTime
(
LocalDateTime
.
now
());
operate
.
setCreateBy
(
user
.
getId
());
if
(
InsurancesConstants
.
SUCCESS
.
equals
(
param
.
getHandType
())){
operate
.
setOperateDesc
(
"减员成功"
);
}
else
{
operate
.
setOperateDesc
(
"减员退回"
);
}
}
}
tInsuranceOperateService
.
saveBatch
(
operateList
);
return
R
.
ok
(
errorList
,
"导入成功"
);
}
/**
...
...
@@ -3495,33 +3550,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
tInsuranceOperateService
.
saveBatch
(
operateList
);
List
<
DeptChangeCheckParam
>
errorList
=
stringListMap
.
get
(
"errorList"
);
return
R
.
ok
(
errorList
,
"导入成功"
);
}
/**
* 发送变更项目至EKP
*
* @author zhaji
* @param successList
* @return void
*/
private
void
updateDeptNo2EKP
(
List
<
TInsuranceDetail
>
successList
)
{
for
(
TInsuranceDetail
param
:
successList
)
{
}
}
/**
* 发送作废信息至EKP
*
* @author zhaji
* @param cancelList 作废信息列表
* @return void
*/
private
void
pushSettleCancel2EKP
(
List
<
TInsuranceSettleCancel
>
cancelList
)
{
for
(
TInsuranceSettleCancel
param
:
cancelList
)
{
}
return
R
.
ok
(
errorList
,
InsurancesConstants
.
IMPORT_SUCCESS
);
}
/**
...
...
@@ -3565,7 +3594,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
YifuUser
user
=
SecurityUtils
.
getUser
();
TInsuranceDetail
insuranceDetail
=
getById
(
id
);
if
(
Common
.
isEmpty
(
insuranceDetail
)
||
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getDeleteFlag
()){
return
R
.
failed
(
"保单信息不存在或已被删除"
);
return
R
.
failed
(
InsurancesConstants
.
INSURANCES_IS_DELETE
);
}
Integer
reduceHandleStatus
=
insuranceDetail
.
getReduceHandleStatus
();
Integer
buyHandleStatus
=
insuranceDetail
.
getBuyHandleStatus
();
...
...
@@ -4085,6 +4114,188 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
map
.
put
(
"successList"
,
successList
);
return
map
;
}
/**
* 减员办理校验
*
* @author zhaji
* @param settleMonthCheckList 减员办理校验
* @return {@link R}
*/
private
Map
<
String
,
List
<
InsuranceRefundImportParam
>>
insuranceChangeCheck
(
List
<
InsuranceRefundImportParam
>
settleMonthCheckList
,
YifuUser
user
)
{
Map
<
String
,
List
<
InsuranceRefundImportParam
>>
map
=
new
HashMap
<>(
16
);
List
<
InsuranceRefundImportParam
>
errorList
=
new
ArrayList
<>();
List
<
InsuranceRefundImportParam
>
successList
=
new
ArrayList
<>();
for
(
InsuranceRefundImportParam
param
:
settleMonthCheckList
)
{
//办理结果
String
handType
=
param
.
getHandType
();
if
(
StringUtils
.
isBlank
(
handType
)){
param
.
setErrorMessage
(
InsurancesConstants
.
HAND_RESULT_IS_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
if
(!
InsurancesConstants
.
SUCCESS
.
equals
(
handType
)
&&
!
InsurancesConstants
.
FAILED
.
equals
(
handType
)){
param
.
setErrorMessage
(
InsurancesConstants
.
HAND_RESULT_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//办理意见
String
remark
=
param
.
getRemark
();
if
(
InsurancesConstants
.
FAILED
.
equals
(
handType
)
&&
StringUtils
.
isBlank
(
remark
)){
param
.
setErrorMessage
(
InsurancesConstants
.
REFUND_MESSAGE_IS_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//员工姓名
String
empName
=
param
.
getEmpName
();
if
(
StringUtils
.
isBlank
(
empName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//员工身份证
String
empIdCardNo
=
param
.
getEmpIdcardNo
();
if
(
StringUtils
.
isBlank
(
empIdCardNo
)){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//保险公司名称
String
insuranceCompanyName
=
param
.
getInsuranceCompanyName
();
if
(
StringUtils
.
isBlank
(
insuranceCompanyName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//险种名称
String
insuranceTypeName
=
param
.
getInsuranceTypeName
();
if
(
StringUtils
.
isBlank
(
insuranceTypeName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//购买标准
String
buyStandard
=
param
.
getBuyStandard
();
if
(
StringUtils
.
isBlank
(
buyStandard
)){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_STANDARD_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//保单开始日期
String
policyStart
=
param
.
getPolicyStart
();
if
(
StringUtils
.
isBlank
(
policyStart
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
//保单结束日期
String
policyEnd
=
param
.
getPolicyEnd
();
if
(
StringUtils
.
isBlank
(
policyEnd
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_NOT_EMPTY
);
errorList
.
add
(
param
);
continue
;
}
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
errorList
.
add
(
param
);
continue
;
}
// 保单开始日期格式校验
if
(!
LocalDateUtil
.
isDate
(
policyStart
,
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
// 保单结束日期格式校验
if
(!
LocalDateUtil
.
isDate
(
policyEnd
,
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_PARSE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
LambdaQueryWrapper
<
TInsuranceDetail
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
.
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
)
.
eq
(
TInsuranceDetail
::
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
policyStart
)
)
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
))
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
);
TInsuranceDetail
insuranceDetail
=
getOne
(
queryWrapper
);
//如果保单信息为空
if
(
Common
.
isEmpty
(
insuranceDetail
)){
param
.
setErrorMessage
(
InsurancesConstants
.
USER_DATA_IS_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
String
detailId
=
insuranceDetail
.
getId
();
//查数据是否存在权限范围内
String
regionSQL
=
getRegionSQL
(
user
);
TInsuranceDetail
detailByRegionSQL
=
this
.
baseMapper
.
selectByregionSQL
(
regionSQL
,
detailId
);
if
(!
Optional
.
ofNullable
(
detailByRegionSQL
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
NO_DETAIL_JURISDICTION
);
errorList
.
add
(
param
);
continue
;
}
//投保办理状态
Integer
buyHandleStatus
=
insuranceDetail
.
getBuyHandleStatus
();
//减员状态
Integer
reduceHandleStatus
=
insuranceDetail
.
getReduceHandleStatus
();
//商险待投保,无法办理
if
(
CommonConstants
.
ONE_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_HANDLE_STATUS_ONE_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保中,无法办理
if
(
CommonConstants
.
TWO_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_HANDLE_STATUS_TWO_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保成功,无法办理
if
(
CommonConstants
.
THREE_INT
==
buyHandleStatus
&&
null
==
reduceHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_HANDLE_STATUS_THREE_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保退回,无法办理
if
(
CommonConstants
.
FOUR_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_HANDLE_STATUS_FOUR_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
if
(
null
!=
reduceHandleStatus
){
//待减员
if
(
CommonConstants
.
ONE_INT
==
reduceHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
REFUND_STATUS_ONE_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//已减员
if
(
CommonConstants
.
THREE_INT
==
reduceHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
REFUND_STATUS_THREE_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//减员退回
if
(
CommonConstants
.
FOUR_INT
==
reduceHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
REFUND_STATUS_FOUR_HANDLE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
}
param
.
setId
(
detailId
);
successList
.
add
(
param
);
}
map
.
put
(
"errorList"
,
errorList
);
map
.
put
(
"successList"
,
successList
);
return
map
;
}
/**
* 校验所属项目
*
...
...
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