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
31a7253d
Commit
31a7253d
authored
Jul 27, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换接口调试
parent
bc1aab6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
21 deletions
+125
-21
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+30
-6
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+95
-15
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
31a7253d
...
...
@@ -77,9 +77,9 @@ public class InsurancesConstants {
*/
public
static
final
String
DATA_IS_NOT_EXIST
=
"投保信息不存在"
;
/**
* 被替换
信息
不存在
* 被替换
员工投保记录
不存在
*/
public
static
final
String
REPLACE_IS_NOT_EXIST
=
"被替换
信息
不存在"
;
public
static
final
String
REPLACE_IS_NOT_EXIST
=
"被替换
员工投保记录
不存在"
;
/**
* 项目编码不存在
*/
...
...
@@ -89,13 +89,37 @@ public class InsurancesConstants {
*/
public
static
final
String
PROJECT_NOT_FIND_SETTLE_TYPE
=
"未找到结算主体的结算方式"
;
/**
* 替换
者信息
已存在
* 替换
员工投保记录
已存在
*/
public
static
final
String
REPLACE_IS_EXIST
=
"替换
者信息
已存在"
;
public
static
final
String
REPLACE_IS_EXIST
=
"替换
员工投保记录
已存在"
;
/**
*
无效、已过期、已出险、已减员的 不能
替换
*
当前记录是待投保,无法
替换
*/
public
static
final
String
REPLACE_IS_NOT_ALLOW
=
"无效、已过期、已出险、已减员的 不能替换"
;
public
static
final
String
ONE_REPLACE_IS_NOT_ALLOW
=
"当前记录是待投保,无法替换"
;
/**
* 当前记录是投保中,无法替换
*/
public
static
final
String
TWO_REPLACE_IS_NOT_ALLOW
=
"当前记录是投保中,无法替换"
;
/**
* 当前记录已出险,无法替换
*/
public
static
final
String
USE_REPLACE_IS_NOT_ALLOW
=
"当前记录已出险,无法替换"
;
/**
* 当前记录已失效,无法替换
*/
public
static
final
String
EFFECT_REPLACE_IS_NOT_ALLOW
=
"当前记录已失效,无法替换"
;
/**
* 当前记录已过期,无法替换
*/
public
static
final
String
OVERDUE_REPLACE_IS_NOT_ALLOW
=
"当前记录已过期,无法替换"
;
/**
* 当前记录已减员,无法替换
*/
public
static
final
String
FIVE_REPLACE_IS_NOT_ALLOW
=
"当前记录已减员,无法替换"
;
/**
* 当前记录在减员流程中,无法替换
*/
public
static
final
String
REDUCE_REPLACE_IS_NOT_ALLOW
=
"当前记录在减员流程中,无法替换"
;
/**
* 员工姓名不能为空
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
31a7253d
...
...
@@ -1250,11 +1250,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
if
(!
ValidityUtil
.
validate20
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_MORE_THAN_20
);
listResult
.
add
(
param
);
continue
;
}
if
(
StringUtils
.
isBlank
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_EMPTY
);
listResult
.
add
(
param
);
...
...
@@ -1318,11 +1313,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
listResult
.
add
(
param
);
continue
;
}
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getReplaceEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
REPLACE_EMP_IDCARD_NO_NOT_LEGITIMATE
);
listResult
.
add
(
param
);
...
...
@@ -1342,6 +1332,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//根据项目编码查询项目是否存在
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
Arrays
.
asList
(
param
.
getDeptNo
()));
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
if
(
MapUtils
.
isEmpty
(
data
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
ProjectSetInfoVo
projectSetInfoVo
=
data
.
get
(
param
.
getDeptNo
());
if
(
null
==
projectSetInfoVo
){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
}
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
...
...
@@ -1369,28 +1377,100 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
// 无效、已过期、已出险、已减员的 不能替换
// 投保状态 待投保 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
ONE_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 投保中 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
TWO_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
TWO_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 已投保 已出险 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
THREE_INT
&&
detail
.
getIsUse
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
USE_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 已投保 已失效 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
THREE_INT
&&
detail
.
getIsEffect
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
EFFECT_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 已投保 已过期 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
THREE_INT
&&
detail
.
getIsOverdue
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
OVERDUE_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 已减员 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
FIVE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
REPLACE_IS_NOT_ALLOW
);
param
.
setErrorMessage
(
InsurancesConstants
.
FIVE_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 已投保 减员状态 待减员/减员中 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
THREE_INT
&&
(
detail
.
getReduceHandleStatus
()
==
CommonConstants
.
ONE_INT
||
detail
.
getReduceHandleStatus
()
==
CommonConstants
.
TWO_INT
)){
param
.
setErrorMessage
(
InsurancesConstants
.
REDUCE_REPLACE_IS_NOT_ALLOW
);
listResult
.
add
(
param
);
continue
;
}
}
//替换者数据查重校验:替换姓名 + 替换身份证号 + 替换项目编码 + 保险公司 + 险种名称
//替换者数据查重校验:替换姓名 + 替换身份证号 + 替换项目编码? + 保险公司 + 险种名称
//待投保、投保中、已投保(有效、未过期)
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
setRStatus
.
add
(
CommonConstants
.
FIVE_INT
);
TInsuranceDetail
replace
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getReplaceEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getReplaceEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getDeptNo
,
param
.
getReplaceDeptNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
//加状态??
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
param
.
getPolicyStart
())
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
param
.
getPolicyEnd
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
ne
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ONE_INT
)
.
ne
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ONE_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
replace
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
REPLACE_IS_EXIST
);
listResult
.
add
(
param
);
continue
;
}
//时间区间
TInsuranceDetail
insuranceDetailBetween
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getReplaceEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getReplaceEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
wrapper
->
wrapper
.
between
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
or
()
.
between
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
)
.
ne
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ONE_INT
)
.
ne
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ONE_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetailBetween
).
isPresent
()){
param
.
setErrorMessage
(
"替换员工在["
+
param
.
getPolicyStart
()+
"-"
+
param
.
getPolicyEnd
()+
"]期间内有投保记录"
);
listResult
.
add
(
param
);
continue
;
}
listSuccess
.
add
(
param
);
}
...
...
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