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
5cf7bde6
Commit
5cf7bde6
authored
Aug 01, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-licancan' into 'develop'
Feature licancan See merge request fangxinjiang/yifu!79
parents
47ee39d2
1bbdfcce
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
211 additions
and
130 deletions
+211
-130
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+12
-0
InsuranceAddParam.java
...u/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
+13
-0
InsuranceBatchParam.java
...cloud/plus/v1/yifu/insurances/vo/InsuranceBatchParam.java
+13
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+170
-129
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+3
-1
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
5cf7bde6
...
@@ -75,6 +75,18 @@ public class TInsuranceDetail extends BaseEntity {
...
@@ -75,6 +75,18 @@ public class TInsuranceDetail extends BaseEntity {
@Schema
(
description
=
"购买标准"
)
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
private
String
buyStandard
;
/**
* 费率
*/
@Schema
(
description
=
"费率"
)
private
BigDecimal
rate
;
/**
* 计费方式
*/
@Schema
(
description
=
"计费方式(0:按天,1:按月)"
)
private
Integer
billingType
;
/**
/**
* 医疗额度
* 医疗额度
*/
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
View file @
5cf7bde6
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
/**
* @author licancan
* @author licancan
...
@@ -134,6 +135,18 @@ public class InsuranceAddParam implements Serializable {
...
@@ -134,6 +135,18 @@ public class InsuranceAddParam implements Serializable {
@JsonIgnore
@JsonIgnore
private
Long
insuranceTypeId
;
private
Long
insuranceTypeId
;
/**
* 费率
*/
@JsonIgnore
private
BigDecimal
rate
;
/**
* 计费方式
*/
@JsonIgnore
private
Integer
billingType
;
/**
/**
* 商险购买地省code
* 商险购买地省code
*/
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceBatchParam.java
View file @
5cf7bde6
...
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
...
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
/**
/**
...
@@ -130,6 +131,18 @@ public class InsuranceBatchParam implements Serializable {
...
@@ -130,6 +131,18 @@ public class InsuranceBatchParam implements Serializable {
@JsonIgnore
@JsonIgnore
private
Long
insuranceTypeId
;
private
Long
insuranceTypeId
;
/**
* 费率
*/
@JsonIgnore
private
BigDecimal
rate
;
/**
* 计费方式
*/
@JsonIgnore
private
Integer
billingType
;
/**
/**
* 商险购买地省code
* 商险购买地省code
*/
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
5cf7bde6
...
@@ -421,6 +421,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -421,6 +421,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
}
else
{
}
else
{
//冗余保险公司计费方式
byId
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
@@ -429,6 +432,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -429,6 +432,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
}
else
{
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
@@ -443,6 +447,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -443,6 +447,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
}
else
{
//冗余费率
byId
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
...
@@ -718,41 +740,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -718,41 +740,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据结算类型判断是否需要计算预估保费
//根据结算类型判断是否需要计算预估保费
//预估
//预估
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
){
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
){
//根据险种获取费率,没费率返回错误
if
(
CommonConstants
.
ONE_INT
==
detail
.
getBillingType
()){
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getById
(
detail
.
getInsuranceTypeId
());
// 按月查费率
//险种存不存在
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
errorList
.
add
(
listVO
);
}
else
{
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getById
(
insuranceType
.
getInsuranceCompanyId
());
//保险公司存不存在
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
errorList
.
add
(
listVO
);
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//按月查费率
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
detail
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
errorList
.
add
(
listVO
);
}
else
{
// 预估保费 = 费率 * 购买标准
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
typeRate
.
getRate
()
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
detail
.
getRate
(
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
...
@@ -779,7 +770,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -779,7 +770,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail
.
setDefaultSettleId
(
settle
.
getId
());
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
successList
.
add
(
detail
);
}
}
else
{
}
else
{
//按天
//按天
//计算起止时间的天数
//计算起止时间的天数
...
@@ -814,8 +805,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -814,8 +805,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successList
.
add
(
detail
);
successList
.
add
(
detail
);
}
}
}
}
}
}
//实缴
//实缴
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ONE_INT
){
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ONE_INT
){
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
...
@@ -1151,6 +1140,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1151,6 +1140,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
else
{
}
else
{
//冗余保险公司计费方式
param
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
@@ -1161,6 +1153,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1161,6 +1153,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
else
{
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
@@ -1177,6 +1170,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1177,6 +1170,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余费率
param
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
}
}
...
@@ -1440,6 +1453,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1440,6 +1453,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
}
}
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条
TInsuranceDetail
limitOne
=
this
.
baseMapper
.
selectOne
(
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
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setPolicyStart
(
limitOne
.
getPolicyStart
());
param
.
setPolicyEnd
(
limitOne
.
getPolicyEnd
());
}
// 保险公司-险种-购买标准 是否存在
// 保险公司-险种-购买标准 是否存在
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
())
...
@@ -1450,6 +1489,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1450,6 +1489,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
else
{
}
else
{
//冗余保险公司计费方式
param
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
@@ -1460,6 +1502,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1460,6 +1502,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
else
{
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
@@ -1476,9 +1519,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1476,9 +1519,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
().
toString
(),
param
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余费率
param
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
}
}
if
(!
limitOne
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_COMPANY_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
if
(!
limitOne
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_TYPE_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if
(!
LocalDateUtil
.
isDate
(
param
.
getSettleMonth
(),
LocalDateUtil
.
NORM_MONTH_PATTERN
)){
if
(!
LocalDateUtil
.
isDate
(
param
.
getSettleMonth
(),
LocalDateUtil
.
NORM_MONTH_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_PARSE_ERROR
);
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_PARSE_ERROR
);
...
@@ -1520,41 +1595,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1520,41 +1595,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条
TInsuranceDetail
limitOne
=
this
.
baseMapper
.
selectOne
(
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
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
if
(!
limitOne
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_COMPANY_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
else
if
(!
limitOne
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_TYPE_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setPolicyStart
(
limitOne
.
getPolicyStart
());
param
.
setPolicyEnd
(
limitOne
.
getPolicyEnd
());
}
}
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 @
5cf7bde6
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
<result
property=
"insuranceTypeName"
column=
"INSURANCE_TYPE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeName"
column=
"INSURANCE_TYPE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"BIGINT"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"BIGINT"
/>
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"rate"
column=
"RATE"
jdbcType=
"DECIMAL"
/>
<result
property=
"billingType"
column=
"BILLING_TYPE"
jdbcType=
"TINYINT"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"policyNo"
column=
"POLICY_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"policyNo"
column=
"POLICY_NO"
jdbcType=
"VARCHAR"
/>
...
@@ -54,7 +56,7 @@
...
@@ -54,7 +56,7 @@
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
ID,EMP_NAME,
ID,EMP_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,POLICY_NO,
INSURANCE_TYPE_ID,BUY_STANDARD,
RATE,BILLING_TYPE,
MEDICAL_QUOTA,DIE_DISABLE_QUOTA,POLICY_NO,
POLICY_START,POLICY_END,POLICY_EFFECT,
POLICY_START,POLICY_END,POLICY_EFFECT,
BATCH_DATE,SETTLE_MONTH,INVOICE_NO,
BATCH_DATE,SETTLE_MONTH,INVOICE_NO,
BUY_TYPE,INSURANCE_PROVINCE,INSURANCE_PROVINCE_NAME,INSURANCE_CITY,INSURANCE_CITY_NAME,
BUY_TYPE,INSURANCE_PROVINCE,INSURANCE_PROVINCE_NAME,INSURANCE_CITY,INSURANCE_CITY_NAME,
...
...
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