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
7fa9129b
Commit
7fa9129b
authored
Dec 08, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:批增,根据保单号获取起止保时间改为从保单表中查询
parent
680872c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
18 deletions
+31
-18
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+8
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+20
-18
TInsurancePolicyServiceImpl.java
...s/service/insurance/impl/TInsurancePolicyServiceImpl.java
+3
-0
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
7fa9129b
...
...
@@ -273,6 +273,10 @@ public class InsurancesConstants {
* 保单结束时间格式错误
*/
public
static
final
String
POLICY_END_PARSE_ERROR
=
"保单结束时间格式错误"
;
/**
* 保单结束时间需要大于派单日期
*/
public
static
final
String
POLICY_END_SHOULD_IS_FUTURE
=
"保单结束时间需要大于派单日期"
;
/**
* 购买标准不能为空
*/
...
...
@@ -389,6 +393,10 @@ public class InsurancesConstants {
* 保单号不存在或已过期
*/
public
static
final
String
POLICY_NO_EXIST
=
"保单号不存在或已过期"
;
/**
* 保单号被禁用
*/
public
static
final
String
POLICY_NO_FORBIDDEN
=
"保单号被禁用"
;
/**
* 保单号不存在
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
7fa9129b
...
...
@@ -2551,29 +2551,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
else
{
param
.
setInsuranceCity
(
Integer
.
parseInt
(
redisCityName
));
}
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条
TInsuranceDetail
limitOne
=
getOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsuranceDetail:
:
getBuyHandleStatus
,
CommonConstants
.
THREE_INT
)
//有效
/*.and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect)
)*/
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
//保单开始日期、结束日期,根据保单号到t_insurance_policy表查询的 1128需求调整改造
TInsurancePolicy
limitOne
=
tInsurancePolicyService
.
getOne
(
Wrappers
.<
TInsurancePolicy
>
query
().
lambda
()
.
eq
(
TInsurancePolicy:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsurancePolicy:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
if
(
limitOne
.
getEnableFlag
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_FORBIDDEN
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isFutureDate
(
limitOne
.
getPolicyEnd
().
toString
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_SHOULD_IS_FUTURE
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
compareDate
(
limitOne
.
getPolicyStart
().
toString
(),
limitOne
.
getPolicyEnd
().
toString
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_LESS_THAN_POLICY_END
);
listResult
.
add
(
param
);
continue
;
}
param
.
setPolicyStart
(
limitOne
.
getPolicyStart
());
param
.
setPolicyEnd
(
limitOne
.
getPolicyEnd
());
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsurancePolicyServiceImpl.java
View file @
7fa9129b
...
...
@@ -128,6 +128,9 @@ public class TInsurancePolicyServiceImpl extends ServiceImpl<TInsurancePolicyMap
if
(!
Optional
.
ofNullable
(
tInsurancePolicy
).
isPresent
()){
return
R
.
failed
(
"数据不存在"
);
}
if
(!
param
.
getPolicyNo
().
equals
(
tInsurancePolicy
.
getPolicyNo
())){
return
R
.
failed
(
"保单号不能修改"
);
}
//操作日志
tBusinessOperateService
.
saveModificationRecord
(
param
.
getId
(),
tInsurancePolicy
,
param
,
null
);
BeanCopyUtils
.
copyProperties
(
param
,
tInsurancePolicy
);
...
...
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