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
6b327532
Commit
6b327532
authored
Aug 01, 2022
by
zhaji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"feature-zhaJi:优化变更项目时的预估保费计算"
parent
5cf7bde6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
168 deletions
+21
-168
TInsuranceSettleCancel.java
...lus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
+5
-125
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+16
-43
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
View file @
6b327532
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -7,6 +10,8 @@ import java.util.Date;
* 结算信息作废记录表(用于记录项目变更导致推信息送至EKP)
* @TableName t_insurance_settle_cancel
*/
@Data
@Tag
(
name
=
"结算信息作废记录"
)
public
class
TInsuranceSettleCancel
implements
Serializable
{
/**
*
...
...
@@ -55,129 +60,4 @@ public class TInsuranceSettleCancel implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
public
String
getId
()
{
return
id
;
}
/**
*
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 结算明细id
*/
public
String
getInsDetailId
()
{
return
insDetailId
;
}
/**
* 结算明细id
*/
public
void
setInsDetailId
(
String
insDetailId
)
{
this
.
insDetailId
=
insDetailId
;
}
/**
* 结算信息表id
*/
public
String
getSettleId
()
{
return
settleId
;
}
/**
* 结算信息表id
*/
public
void
setSettleId
(
String
settleId
)
{
this
.
settleId
=
settleId
;
}
/**
* 项目编码
*/
public
String
getDeptNo
()
{
return
deptNo
;
}
/**
* 项目编码
*/
public
void
setDeptNo
(
String
deptNo
)
{
this
.
deptNo
=
deptNo
;
}
/**
* 项目名称
*/
public
String
getDeptName
()
{
return
deptName
;
}
/**
* 项目名称
*/
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
/**
* 订单编号
*/
public
String
getOrderNo
()
{
return
orderNo
;
}
/**
* 订单编号
*/
public
void
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
/**
* 推送标识 1成功 0失败
*/
public
Integer
getIsCancelPush
()
{
return
isCancelPush
;
}
/**
* 推送标识 1成功 0失败
*/
public
void
setIsCancelPush
(
Integer
isCancelPush
)
{
this
.
isCancelPush
=
isCancelPush
;
}
/**
* 创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 操作人
*/
public
String
getCreateUesr
()
{
return
createUesr
;
}
/**
* 操作人
*/
public
void
setCreateUesr
(
String
createUesr
)
{
this
.
createUesr
=
createUesr
;
}
}
\ No newline at end of file
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
6b327532
...
...
@@ -2570,6 +2570,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle
.
setEstimatePremium
(
new
BigDecimal
(
"0"
));
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
//生成一条作废数据并推送至EKP
TInsuranceSettleCancel
tInsuranceSettleCancel
=
new
TInsuranceSettleCancel
();
tInsuranceSettleCancel
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettleCancel
.
setSettleId
(
success
.
getDefaultSettleId
());
}
else
{
//更新预估保费
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0"
));
...
...
@@ -3200,7 +3205,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList
.
add
(
param
);
continue
;
}
//保单开始日期
String
policyStart
=
param
.
getPolicyStart
();
if
(
StringUtils
.
isBlank
(
policyStart
)){
...
...
@@ -3328,40 +3332,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//预估
if
(
param
.
getNewSettleType
()
==
CommonConstants
.
ZERO_INT
){
//根据险种获取费率,没费率返回错误
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getById
(
insuranceDetail
.
getInsuranceTypeId
());
//险种存不存在
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
else
{
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getById
(
insuranceType
.
getInsuranceCompanyId
());
//保险公司存不存在
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//按月查费率
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
insuranceDetail
.
getPolicyStart
().
toString
(),
insuranceDetail
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceDetail
.
getInsuranceTypeId
())
.
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
);
errorList
.
add
(
param
);
continue
;
}
else
{
//按月
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getBillingType
()){
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
typeRate
.
getRate
()
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
multiply
(
insuranceDetail
.
getRate
(
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
param
.
setEstimatePremium
(
estimatePremium
);
}
}
else
{
//按天
//计算起止时间的天数
...
...
@@ -3371,8 +3346,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setEstimatePremium
(
estimatePremium
);
}
}
}
}
param
.
setOldSettleType
(
insuranceDetail
.
getSettleType
());
param
.
setDefaultSettleId
(
insuranceDetail
.
getDefaultSettleId
());
param
.
setId
(
insuranceDetail
.
getId
());
...
...
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