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
0b4b7931
Commit
0b4b7931
authored
Feb 20, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险优化修改
parent
9b58c4ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
46 deletions
+52
-46
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+52
-46
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
0b4b7931
...
...
@@ -1148,6 +1148,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//操作日志对象
List
<
InsuranceHandleParam
>
operateList
=
new
ArrayList
<>();
//根据id获取所有的商险明细
List
<
TInsuranceDetail
>
detailList
=
baseMapper
.
selectBatchIds
(
idList
);
//返回给前端的数据
List
<
InsuranceListVO
>
errorList
=
new
ArrayList
<>();
...
...
@@ -1160,6 +1161,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
CollectionUtils
.
isNotEmpty
(
detailList
)){
TInsuranceReplace
one
;
TInsuranceDetail
byId
;
List
<
TInsuranceDetail
>
updList
=
new
ArrayList
<>();
List
<
TInsuranceReplace
>
replaceList
=
new
ArrayList
<>();
for
(
TInsuranceDetail
detail
:
detailList
)
{
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
FOUR_INT
||
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
FIVE_INT
){
...
...
@@ -1187,13 +1190,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
//替换记录变为失败
one
.
setReplaceStatus
(
CommonConstants
.
ZERO_INT
);
tInsuranceReplaceService
.
updateByI
d
(
one
);
replaceList
.
ad
d
(
one
);
byId
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
byId
).
isPresent
()){
//被替换者激活
byId
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
byId
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
this
.
updateByI
d
(
byId
);
updList
.
ad
d
(
byId
);
}
}
}
...
...
@@ -1215,10 +1218,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replaceIdList
.
add
(
detail
.
getId
());
}
}
//批量更新商险和替换表
if
(!
updList
.
isEmpty
())
{
this
.
updateBatchById
(
updList
);
updList
.
clear
();
}
if
(!
replaceList
.
isEmpty
())
{
tInsuranceReplaceService
.
updateBatchById
(
replaceList
);
replaceList
.
clear
();
}
}
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
TInsuranceSettle
settle
;
SettleVo
settleVo
;
R
<
TIncomeDetailReturnVo
>
incomeDetailList
;
for
(
TInsuranceDetail
detail
:
successList
)
{
if
(
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
())){
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
...
...
@@ -1286,7 +1299,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//已投保退回,收入数据同步处理
try
{
updateInsuranceInfo
(
detail
);
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
detail
.
getId
());
incomeDetailList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
incomeDetailList
)
&&
incomeDetailList
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
for
(
TIncomeDetail
detailIncome
:
incomeDetailList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detailIncome
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detail1
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detail1
);
}
}
}
catch
(
Exception
e
){
log
.
error
(
"收入数据同步处理失败:"
+
e
);
}
...
...
@@ -1333,7 +1358,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
InsuranceHandleImportParam
>
collectSuccess
=
successList
.
stream
().
filter
(
e
->
InsurancesConstants
.
SUCCESS
.
equals
(
e
.
getHandType
())).
collect
(
Collectors
.
toList
());
//投保退回的数据
List
<
InsuranceHandleImportParam
>
collectRollBack
=
successList
.
stream
().
filter
(
e
->
InsurancesConstants
.
FAILED
.
equals
(
e
.
getHandType
())).
collect
(
Collectors
.
toList
());
successList
.
clear
();
//投保成功
if
(
CollectionUtils
.
isNotEmpty
(
collectSuccess
)){
List
<
InsuranceHandleParam
>
list
=
new
ArrayList
<>();
...
...
@@ -1343,6 +1368,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
handleParam
.
setRemark
(
e
.
getRemark
());
list
.
add
(
handleParam
);
});
collectSuccess
.
clear
();
// 关联档案1
this
.
successfulInsurance
(
user
,
list
);
}
...
...
@@ -1356,6 +1382,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
handleParam
.
setRemark
(
e
.
getRemark
());
list
.
add
(
handleParam
);
});
collectRollBack
.
clear
();
// 关联档案2
this
.
rollBackInsurance
(
user
,
list
);
}
...
...
@@ -1475,10 +1502,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
String
settleId
=
RandomStringUtils
.
randomNumeric
(
19
);
settle
.
setId
(
settleId
);
settle
.
setId
(
RandomStringUtils
.
randomNumeric
(
19
));
settleList
.
add
(
settle
);
detail
.
setDefaultSettleId
(
settle
Id
);
detail
.
setDefaultSettleId
(
settle
.
getId
()
);
successTwo
.
add
(
detail
);
//生成收入数据
createInsuranceInfo
(
detail
,
settleDomain
);
...
...
@@ -1512,10 +1538,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
String
settleId
=
RandomStringUtils
.
randomNumeric
(
19
);
settle
.
setId
(
settleId
);
settle
.
setId
(
RandomStringUtils
.
randomNumeric
(
19
));
settleList
.
add
(
settle
);
detail
.
setDefaultSettleId
(
settle
Id
);
detail
.
setDefaultSettleId
(
settle
.
getId
()
);
successTwo
.
add
(
detail
);
//生成收入数据
createInsuranceInfo
(
detail
,
settleDomain
);
...
...
@@ -4805,26 +4830,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
update
(
updateWrapper
);
//更换项目更新收入
TInsuranceDetail
income
=
getOne
(
lambdaQuery
().
getWrapper
().
eq
(
TInsuranceDetail:
:
getId
,
success
.
getId
()));
if
(
Common
.
isNotNull
(
income
))
{
if
(
income
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
)
{
if
(
Common
.
isNotNull
(
income
)
&&
income
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
)
{
//判断是否存在当月的商险收入数据
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
income
.
getId
());
R
<
TIncomeDetailReturnVo
>
detailList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
)
&&
detailList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
detailList
.
getData
().
getDetailList
().
size
()
>
0
)
{
&&
!
detailList
.
getData
().
getDetailList
().
isEmpty
()
)
{
//原项目生成红冲数据
for
(
TIncomeDetail
detail
:
detailList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detail
,
detail1
);
BeanCopyUtils
.
copyProperties
(
detail
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detail
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detail1
);
}
//新项目下生成收入数据
createInsuranceInfo
(
income
,
null
);
}
createInsuranceInfo
(
income
,
null
);
}
}
//商险id
...
...
@@ -7257,23 +7280,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
socialDaprUtils
.
createTIncomeDetail
(
detail
);
}
//更新收入信息
public
void
updateInsuranceInfo
(
TInsuranceDetail
insuranceDetail
)
{
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
insuranceDetail
.
getId
());
R
<
TIncomeDetailReturnVo
>
detailList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
)
&&
detailList
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
for
(
TIncomeDetail
detail
:
detailList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detail
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detail1
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detail1
);
}
}
}
@Override
public
void
ekpUpdateInsuranceDept
(
ChangeDeptVo
changeDeptVo
)
{
Set
<
String
>
detailIdSet
=
new
HashSet
<>();
...
...
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