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
4c29d2ec
Commit
4c29d2ec
authored
Jul 28, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险推送ekp之前的逻辑完善
parent
c39075c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
10 deletions
+73
-10
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+73
-10
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
4c29d2ec
...
...
@@ -579,10 +579,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
//todo 判断是否推送过保费到ekp,如果推送过就新增一条负的,将结算表中的数据求和放到明细表中
for
(
TInsuranceDetail
detail
:
successList
)
{
if
(
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
())){
TInsuranceSettle
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
if
(
Optional
.
ofNullable
(
settle
).
isPresent
()){
TInsuranceSettle
burden
=
new
TInsuranceSettle
();
BeanCopyUtils
.
copyProperties
(
settle
,
burden
);
burden
.
setId
(
null
);
burden
.
setCreateTime
(
LocalDateTime
.
now
());
burden
.
setUpdateTime
(
LocalDateTime
.
now
());
if
(
burden
.
getActualPremium
()
!=
null
){
burden
.
setActualPremium
(
burden
.
getActualPremium
().
negate
());
burden
.
setActualPushTime
(
LocalDateTime
.
now
());
detail
.
setActualPremium
(
new
BigDecimal
(
"0.00"
));
}
if
(
burden
.
getEstimatePremium
()
!=
null
){
burden
.
setEstimatePremium
(
burden
.
getEstimatePremium
().
negate
());
burden
.
setEstimatePushTime
(
LocalDateTime
.
now
());
detail
.
setEstimatePremium
(
new
BigDecimal
(
"0.00"
));
}
tInsuranceSettleService
.
save
(
burden
);
//推送负的给ekp
detail
.
setDefaultSettleId
(
burden
.
getId
());
}
}
}
//更新状态
this
.
saveOrUpdateBatch
(
successList
);
//todo 判断是否推送过保费到ekp,如果推送过就新增一条负的,将结算表中的数据求和放到明细表中
}
//根据项目编码获取项目名称
setProjectNameByDeptNo
(
errorList
);
...
...
@@ -676,7 +702,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
settle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
...
...
@@ -706,7 +734,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
settle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
...
...
@@ -781,17 +811,50 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
success
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
);
if
(
detail
.
getActualPremium
()
!=
null
){
// 已推送过,只更新发票号
if
(
StringUtils
.
isNotBlank
(
success
.
getInvoiceNo
())){
detail
.
setInvoiceNo
(
success
.
getInvoiceNo
());
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
detail
);
}
else
{
}
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
if
(
StringUtils
.
isNotBlank
(
success
.
getPolicyNo
())){
detail
.
setPolicyNo
(
success
.
getPolicyNo
());
}
if
(
StringUtils
.
isNotBlank
(
success
.
getActualPremium
())){
detail
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
// todo 判断是否推送过ekp,没推送过调新增接口,推送过调更新接口
if
(
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
())){
TInsuranceSettle
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
if
(
Optional
.
ofNullable
(
settle
).
isPresent
()){
settle
.
setActualPremium
(
detail
.
getActualPremium
());
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
settle
);
//调更新接口
}
}
else
{
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setActualPremium
(
detail
.
getActualPremium
());
//调完ekp接口才会是1
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
//调新增接口
}
}
//可以改成批量更新
this
.
updateById
(
detail
);
detailList
.
add
(
detail
);
}
}
...
...
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