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
9547f46d
Commit
9547f46d
authored
Jul 26, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
0fba3186
bd9fe556
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
29 deletions
+140
-29
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+30
-14
LocalDateUtil.java
...ifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
+37
-6
InsuranceDetailVO.java
...u/cloud/plus/v1/yifu/insurances/vo/InsuranceDetailVO.java
+6
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+66
-9
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+1
-0
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
9547f46d
...
@@ -100,6 +100,10 @@ public class InsurancesConstants {
...
@@ -100,6 +100,10 @@ public class InsurancesConstants {
* 员工姓名不能为空
* 员工姓名不能为空
*/
*/
public
static
final
String
EMP_NAME_NOT_EMPTY
=
"员工姓名不能为空"
;
public
static
final
String
EMP_NAME_NOT_EMPTY
=
"员工姓名不能为空"
;
/**
* 员工姓名超过20字符长度限制
*/
public
static
final
String
EMP_NAME_MORE_THAN_20
=
"员工姓名超过20字符长度限制"
;
/**
/**
* 替换员工姓名不能为空
* 替换员工姓名不能为空
*/
*/
...
@@ -113,13 +117,13 @@ public class InsurancesConstants {
...
@@ -113,13 +117,13 @@ public class InsurancesConstants {
*/
*/
public
static
final
String
REPLACE_EMP_IDCARD_NO_NOT_EMPTY
=
"替换员工身份证号不能为空"
;
public
static
final
String
REPLACE_EMP_IDCARD_NO_NOT_EMPTY
=
"替换员工身份证号不能为空"
;
/**
/**
* 员工身份证号格式
有
误
* 员工身份证号格式
错
误
*/
*/
public
static
final
String
EMP_IDCARD_NO_NOT_LEGITIMATE
=
"员工身份证号格式
有
误"
;
public
static
final
String
EMP_IDCARD_NO_NOT_LEGITIMATE
=
"员工身份证号格式
错
误"
;
/**
/**
* 员工
姓名、身份证号不一致
* 员工
未通过实名认证
*/
*/
public
static
final
String
EMP_ID_CARD_NO_NOT_FIT
=
"员工
姓名、身份证号不一致
"
;
public
static
final
String
EMP_ID_CARD_NO_NOT_FIT
=
"员工
未通过实名认证
"
;
/**
/**
* 替换员工姓名、身份证号不一致
* 替换员工姓名、身份证号不一致
*/
*/
...
@@ -161,9 +165,13 @@ public class InsurancesConstants {
...
@@ -161,9 +165,13 @@ public class InsurancesConstants {
*/
*/
public
static
final
String
POLICY_START_PARSE_ERROR
=
"保单开始时间格式错误"
;
public
static
final
String
POLICY_START_PARSE_ERROR
=
"保单开始时间格式错误"
;
/**
/**
* 保单开始时间不能小于派单时间
* 保单开始时间需要大于派单日期
*/
public
static
final
String
POLICY_START_SHOULD_IS_FUTURE
=
"保单开始时间需要大于派单日期"
;
/**
* 保单结束时间需要大于保单开始时间
*/
*/
public
static
final
String
POLICY_START_SHOULD_
IS_FUTURE
=
"保单开始时间不能小于派单
时间"
;
public
static
final
String
POLICY_START_SHOULD_
LESS_THAN_POLICY_END
=
"保单结束时间需要大于保单开始
时间"
;
/**
/**
* 保单结束时间不能为空
* 保单结束时间不能为空
*/
*/
...
@@ -185,33 +193,33 @@ public class InsurancesConstants {
...
@@ -185,33 +193,33 @@ public class InsurancesConstants {
*/
*/
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EMPTY
=
"商险购买地省名称不能为空"
;
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EMPTY
=
"商险购买地省名称不能为空"
;
/**
/**
* 商险购买地省
名称
不存在
* 商险购买地省不存在
*/
*/
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EXIST
=
"商险购买地省
名称
不存在"
;
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EXIST
=
"商险购买地省不存在"
;
/**
/**
* 商险购买地市名称
* 商险购买地市名称
*/
*/
public
static
final
String
INSURANCE_CITY_NAME_NOT_EMPTY
=
"商险购买地市名称不能为空"
;
public
static
final
String
INSURANCE_CITY_NAME_NOT_EMPTY
=
"商险购买地市名称不能为空"
;
/**
/**
* 商险购买地市
名称
不存在
* 商险购买地市不存在
*/
*/
public
static
final
String
INSURANCE_CITY_NAME_NOT_EXIST
=
"商险购买地市
名称
不存在"
;
public
static
final
String
INSURANCE_CITY_NAME_NOT_EXIST
=
"商险购买地市不存在"
;
/**
/**
* 商险办理省名称不能为空
* 商险办理省名称不能为空
*/
*/
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY
=
"商险办理省名称不能为空"
;
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY
=
"商险办理省名称不能为空"
;
/**
/**
* 商险办理省
名称
不存在
* 商险办理省不存在
*/
*/
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST
=
"商险办理省
名称
不存在"
;
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST
=
"商险办理省不存在"
;
/**
/**
* 商险办理城市名称不能为空
* 商险办理城市名称不能为空
*/
*/
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY
=
"商险办理城市名称不能为空"
;
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY
=
"商险办理城市名称不能为空"
;
/**
/**
* 商险办理城市
名称
不存在
* 商险办理城市不存在
*/
*/
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EXIST
=
"商险办理城市
名称
不存在"
;
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EXIST
=
"商险办理城市不存在"
;
/**
/**
* 结算月不能为空
* 结算月不能为空
*/
*/
...
@@ -228,6 +236,14 @@ public class InsurancesConstants {
...
@@ -228,6 +236,14 @@ public class InsurancesConstants {
* 岗位不能为空
* 岗位不能为空
*/
*/
public
static
final
String
POST_NOT_EMPTY
=
"岗位不能为空"
;
public
static
final
String
POST_NOT_EMPTY
=
"岗位不能为空"
;
/**
* 岗位长度超过32字符限制
*/
public
static
final
String
POST_NOT_MORE_THAN_32
=
"岗位长度超过32字符限制"
;
/**
* 备注长度超过50字符限制
*/
public
static
final
String
REMARK_NOT_MORE_THAN_50
=
"备注长度超过50字符限制"
;
/**
/**
* 保单号不能为空
* 保单号不能为空
*/
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
View file @
9547f46d
...
@@ -113,6 +113,42 @@ public class LocalDateUtil {
...
@@ -113,6 +113,42 @@ public class LocalDateUtil {
return
flag
;
return
flag
;
}
}
/**
* 比较两个时间的早晚
*
* @author licancan
* @param startDate 开始日期
* @param endDate 结束日期
* @return {@link boolean}
*/
public
static
boolean
compareDate
(
String
startDate
,
String
endDate
){
boolean
flag
=
false
;
//在日期字符串非空时执行
if
(!
Common
.
isEmpty
(
startDate
)
&&
!
Common
.
isEmpty
(
endDate
))
{
Date
parseStartDate
=
null
;
Date
parseEndDate
=
null
;
//格式化日期
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
NORM_DATE_PATTERN
,
Locale
.
CHINA
);
try
{
//将字符串转为日期格式,如果此处字符串为非合法日期就会抛出异常。
parseStartDate
=
sdf
.
parse
(
startDate
);
parseEndDate
=
sdf
.
parse
(
endDate
);
//调用Date里面的before方法来做判断
flag
=
parseStartDate
.
before
(
parseEndDate
);
if
(
flag
)
{
System
.
out
.
println
(
"开始日期早于结束日期"
);
}
else
{
System
.
out
.
println
(
"开始日期晚于结束日期"
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
System
.
out
.
println
(
"日期参数不可为空"
);
}
return
flag
;
}
/**
/**
* 判断传入的月份是否大于等于本月(结算月份 >= 派单月份)
* 判断传入的月份是否大于等于本月(结算月份 >= 派单月份)
*
*
...
@@ -149,12 +185,7 @@ public class LocalDateUtil {
...
@@ -149,12 +185,7 @@ public class LocalDateUtil {
return
flag
;
return
flag
;
}
}
//获取指定时间的指定格式
public
static
String
formatTime
(
LocalDate
time
,
String
pattern
)
{
return
time
.
format
(
DateTimeFormatter
.
ofPattern
(
pattern
));
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
isCurrentOrFutureMonth
(
"2023-1
"
));
System
.
out
.
println
(
compareDate
(
"2022-07-26"
,
"2022-07-27
"
));
}
}
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceDetailVO.java
View file @
9547f46d
...
@@ -94,6 +94,12 @@ public class InsuranceDetailVO implements Serializable {
...
@@ -94,6 +94,12 @@ public class InsuranceDetailVO implements Serializable {
@Schema
(
description
=
"险种名称"
)
@Schema
(
description
=
"险种名称"
)
private
String
insuranceTypeName
;
private
String
insuranceTypeName
;
/**
* 险种主键
*/
@Schema
(
description
=
"险种主键"
)
private
Long
insuranceTypeId
;
/**
/**
* 购买标准
* 购买标准
*/
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
9547f46d
...
@@ -655,6 +655,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -655,6 +655,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
if
(!
ValidityUtil
.
validate20
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_MORE_THAN_20
);
listResult
.
add
(
param
);
continue
;
}
if
(
StringUtils
.
isBlank
(
param
.
getEmpIdcardNo
())){
if
(
StringUtils
.
isBlank
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_EMPTY
);
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_EMPTY
);
listResult
.
add
(
param
);
listResult
.
add
(
param
);
...
@@ -720,6 +725,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -720,6 +725,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
if
(!
ValidityUtil
.
validate32
(
param
.
getPost
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POST_NOT_MORE_THAN_32
);
listResult
.
add
(
param
);
continue
;
}
if
(
StringUtils
.
isNotBlank
(
param
.
getRemark
())){
if
(!
ValidityUtil
.
validate50
(
param
.
getRemark
())){
param
.
setErrorMessage
(
InsurancesConstants
.
REMARK_NOT_MORE_THAN_50
);
listResult
.
add
(
param
);
continue
;
}
}
// 身份证号位数校验(18 位合法)
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
...
@@ -818,6 +838,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -818,6 +838,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
if
(!
LocalDateUtil
.
compareDate
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_LESS_THAN_POLICY_END
);
listResult
.
add
(
param
);
continue
;
}
// 保险公司-险种-购买标准 是否存在
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
...
@@ -856,10 +882,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -856,10 +882,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
}
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if
(!
LocalDateUtil
.
isDate
(
param
.
getSettleMonth
(),
LocalDateUtil
.
NORM_MONTH_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isCurrentOrFutureMonth
(
param
.
getSettleMonth
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_SHOULD_IS_FUTURE
);
listResult
.
add
(
param
);
continue
;
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
//
todo 时间区间
//
待投保、投保中、已投保(有效、未过期)
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
setRStatus
.
add
(
CommonConstants
.
FIVE_INT
);
TInsuranceDetail
insuranceDetail
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
TInsuranceDetail
insuranceDetail
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
...
@@ -869,23 +909,40 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -869,23 +909,40 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
param
.
getPolicyEnd
())
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
param
.
getPolicyEnd
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
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
(
insuranceDetail
).
isPresent
()){
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
DATA_IS_EXIST
);
param
.
setErrorMessage
(
InsurancesConstants
.
DATA_IS_EXIST
);
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if
(!
LocalDateUtil
.
isDate
(
param
.
getSettleMonth
(),
LocalDateUtil
.
NORM_MONTH_PATTERN
)){
//时间区间
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_PARSE_ERROR
);
TInsuranceDetail
insuranceDetailBetween
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
listResult
.
add
(
param
);
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
continue
;
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
}
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
if
(!
LocalDateUtil
.
isCurrentOrFutureMonth
(
param
.
getSettleMonth
())){
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_SHOULD_IS_FUTURE
);
.
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
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
listSuccess
.
add
(
param
);
listSuccess
.
add
(
param
);
}
}
map
.
put
(
"listResult"
,
listResult
);
map
.
put
(
"listResult"
,
listResult
);
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
9547f46d
...
@@ -149,6 +149,7 @@
...
@@ -149,6 +149,7 @@
detail.POLICY_EFFECT as policyEffect,
detail.POLICY_EFFECT as policyEffect,
detail.POLICY_NO as policyNo,
detail.POLICY_NO as policyNo,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.INSURANCE_TYPE_ID as insuranceTypeId,
detail.BUY_STANDARD as buyStandard,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
...
...
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