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
1fbd0173
Commit
1fbd0173
authored
Jan 04, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化修改
parent
91114bde
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
70 deletions
+105
-70
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+4
-67
DoJointInsuranceTask.java
...ud/plus/v1/yifu/insurances/util/DoJointInsuranceTask.java
+101
-3
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 @
1fbd0173
...
@@ -110,9 +110,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -110,9 +110,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource
@Resource
private
SocialDaprUtils
socialDaprUtils
;
private
SocialDaprUtils
socialDaprUtils
;
@Resource
private
SalaryDaprUtil
salaryDaprUtil
;
@Resource
@Resource
private
MenuUtil
menuUtil
;
private
MenuUtil
menuUtil
;
@Resource
@Resource
...
@@ -7230,41 +7227,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -7230,41 +7227,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isEmpty
(
vo
))
{
if
(
Common
.
isEmpty
(
vo
))
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
}
List
<
EkpInsuranceViewVo
>
viewVoList
;
TInsuranceDetail
detail
;
try
{
try
{
//根据结算单号获取明细id和结算状态
doJointInsuranceTask
.
updateInsuranceSettleStatus
(
vo
);
viewVoList
=
ekpSettleService
.
selectViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
if
(!
viewVoList
.
isEmpty
())
{
String
insuranceId
;
for
(
EkpInsuranceViewVo
viewVo
:
viewVoList
)
{
//获取所有的明细id
insuranceId
=
viewVo
.
getId
().
substring
(
0
,
19
);
detail
=
baseMapper
.
selectById
(
insuranceId
);
if
(
Common
.
isNotNull
(
detail
))
{
//判断订单类型是预估还是实缴
if
(
InsurancesConstants
.
ACTUAL_SETTLE_BILL
.
equals
(
viewVo
.
getOrderType
()))
{
//判断是收入还是支出结算单号
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getPayFlag
()))
{
detail
.
setSincomeSettleFlag
(
viewVo
.
getIncomeSettleFlag
());
detail
.
setSincomeCollectFlag
(
viewVo
.
getIncomeCollectFlag
());
}
else
{
detail
.
setSpaySettleFlag
(
viewVo
.
getPaySettleFlag
());
detail
.
setSpayCollectFlag
(
viewVo
.
getPayCollectFlag
());
}
}
else
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getPayFlag
()))
{
detail
.
setIncomeSettleFlag
(
viewVo
.
getIncomeSettleFlag
());
detail
.
setIncomeCollectFlag
(
viewVo
.
getIncomeCollectFlag
());
}
else
{
detail
.
setPaySettleFlag
(
viewVo
.
getPaySettleFlag
());
detail
.
setPayCollectFlag
(
viewVo
.
getPayCollectFlag
());
}
}
baseMapper
.
updateById
(
detail
);
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"商险结算状态更新异常"
,
e
);
log
.
error
(
"商险结算状态更新异常"
,
e
);
return
R
.
failed
(
"商险结算状态更新异常"
);
return
R
.
failed
(
"商险结算状态更新异常"
);
...
@@ -7276,19 +7240,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -7276,19 +7240,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isEmpty
(
vo
))
{
if
(
Common
.
isEmpty
(
vo
))
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
}
List
<
EkpSocialViewVo
>
viewVo
;
try
{
try
{
//根据结算单号获取明细id和结算状态
doJointInsuranceTask
.
updateSocialSettleStatus
(
vo
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getTypeFlag
()))
{
viewVo
=
ekpSettleService
.
selectSocialViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
}
else
{
viewVo
=
ekpSettleService
.
selectFundViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
}
if
(!
viewVo
.
isEmpty
())
{
viewVo
.
forEach
(
e
->{
e
.
setPayFlag
(
vo
.
getPayFlag
());});
socialDaprUtils
.
updateSocialSettleStatus
(
viewVo
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"社保结算状态更新异常"
,
e
);
log
.
error
(
"社保结算状态更新异常"
,
e
);
return
R
.
failed
(
"社保结算状态更新异常"
);
return
R
.
failed
(
"社保结算状态更新异常"
);
...
@@ -7300,17 +7253,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -7300,17 +7253,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isEmpty
(
vo
))
{
if
(
Common
.
isEmpty
(
vo
))
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
}
List
<
EkpInsuranceViewVo
>
viewVo
;
try
{
try
{
//根据结算单号获取明细id和结算状态;判断是管理费还是风险金
doJointInsuranceTask
.
updateIncomeSettleStatus
(
vo
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getTypeFlag
()))
{
viewVo
=
ekpSettleService
.
selectIncomelViewBySettleNo
(
vo
.
getSettleNo
());
}
else
{
viewVo
=
ekpSettleService
.
selectFIncomelViewBySettleNo
(
vo
.
getSettleNo
());
}
if
(!
viewVo
.
isEmpty
())
{
socialDaprUtils
.
updateIncomeSettleStatus
(
viewVo
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"收入结算状态更新异常"
,
e
);
log
.
error
(
"收入结算状态更新异常"
,
e
);
return
R
.
failed
(
"收入结算状态更新异常"
);
return
R
.
failed
(
"收入结算状态更新异常"
);
...
@@ -7323,15 +7267,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -7323,15 +7267,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isEmpty
(
vo
))
{
if
(
Common
.
isEmpty
(
vo
))
{
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
}
List
<
EkpSocialViewVo
>
viewVo
;
try
{
try
{
//根据结算单号获取明细id和结算状态
doJointInsuranceTask
.
updateSalarySettleStatus
(
vo
);
viewVo
=
ekpSettleService
.
selectSalarylViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
if
(!
viewVo
.
isEmpty
())
{
viewVo
.
forEach
(
e
->{
e
.
setPayFlag
(
vo
.
getPayFlag
());});
salaryDaprUtil
.
updateSalarySettleStatus
(
viewVo
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"薪资结算状态更新异常"
,
e
);
log
.
error
(
"薪资结算状态更新异常"
,
e
);
return
R
.
failed
(
"薪资结算状态更新异常"
);
return
R
.
failed
(
"薪资结算状态更新异常"
);
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/DoJointInsuranceTask.java
View file @
1fbd0173
...
@@ -3,7 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.util;
...
@@ -3,7 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.util;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants
;
import
com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants
;
import
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil
;
import
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil
;
...
@@ -12,10 +13,15 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
...
@@ -12,10 +13,15 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleCancelService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleCancelService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInteractiveParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInteractiveParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpStatusParamVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -24,6 +30,7 @@ import org.springframework.stereotype.Component;
...
@@ -24,6 +30,7 @@ import org.springframework.stereotype.Component;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
/**
* 主要执行商险的异步推送
* 主要执行商险的异步推送
...
@@ -45,10 +52,19 @@ public class DoJointInsuranceTask {
...
@@ -45,10 +52,19 @@ public class DoJointInsuranceTask {
private
TInsuranceEkpService
tInsuranceEkpService
;
private
TInsuranceEkpService
tInsuranceEkpService
;
@Autowired
@Autowired
private
ArchivesDaprUtil
archivesDaprUtil
;
private
TInsuranceSettleCancelService
tInsuranceSettleCancelService
;
@Autowired
@Autowired
private
TInsuranceSettleCancelService
tInsuranceSettleCancelService
;
private
EkpSettleService
ekpSettleService
;
@Autowired
private
TInsuranceDetailMapper
insuranceDetailMapper
;
@Autowired
private
SocialDaprUtils
socialDaprUtils
;
@Autowired
private
SalaryDaprUtil
salaryDaprUtil
;
/**
/**
* @Description: 商险明细推送
* @Description: 商险明细推送
...
@@ -184,4 +200,86 @@ public class DoJointInsuranceTask {
...
@@ -184,4 +200,86 @@ public class DoJointInsuranceTask {
ekp
.
setPushType
(
pushType
);
ekp
.
setPushType
(
pushType
);
tInsuranceEkpService
.
save
(
ekp
);
tInsuranceEkpService
.
save
(
ekp
);
}
}
@Async
public
void
updateInsuranceSettleStatus
(
EkpStatusParamVo
vo
)
{
//根据结算单号获取明细id和结算状态
List
<
EkpInsuranceViewVo
>
viewVoList
;
TInsuranceDetail
detail
;
viewVoList
=
ekpSettleService
.
selectViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
if
(!
viewVoList
.
isEmpty
())
{
String
insuranceId
;
for
(
EkpInsuranceViewVo
viewVo
:
viewVoList
)
{
//获取所有的明细id
insuranceId
=
viewVo
.
getId
().
substring
(
0
,
19
);
detail
=
insuranceDetailMapper
.
selectById
(
insuranceId
);
if
(
Common
.
isNotNull
(
detail
))
{
//判断订单类型是预估还是实缴
if
(
InsurancesConstants
.
ACTUAL_SETTLE_BILL
.
equals
(
viewVo
.
getOrderType
()))
{
//判断是收入还是支出结算单号
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getPayFlag
()))
{
detail
.
setSincomeSettleFlag
(
viewVo
.
getIncomeSettleFlag
());
detail
.
setSincomeCollectFlag
(
viewVo
.
getIncomeCollectFlag
());
}
else
{
detail
.
setSpaySettleFlag
(
viewVo
.
getPaySettleFlag
());
detail
.
setSpayCollectFlag
(
viewVo
.
getPayCollectFlag
());
}
}
else
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getPayFlag
()))
{
detail
.
setIncomeSettleFlag
(
viewVo
.
getIncomeSettleFlag
());
detail
.
setIncomeCollectFlag
(
viewVo
.
getIncomeCollectFlag
());
}
else
{
detail
.
setPaySettleFlag
(
viewVo
.
getPaySettleFlag
());
detail
.
setPayCollectFlag
(
viewVo
.
getPayCollectFlag
());
}
}
insuranceDetailMapper
.
updateById
(
detail
);
}
}
}
}
@Async
public
void
updateSocialSettleStatus
(
EkpStatusParamVo
vo
)
{
List
<
EkpSocialViewVo
>
viewVo
;
//根据结算单号获取明细id和结算状态
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getTypeFlag
()))
{
viewVo
=
ekpSettleService
.
selectSocialViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
}
else
{
viewVo
=
ekpSettleService
.
selectFundViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
}
if
(!
viewVo
.
isEmpty
())
{
viewVo
.
forEach
(
e
->{
e
.
setPayFlag
(
vo
.
getPayFlag
());});
socialDaprUtils
.
updateSocialSettleStatus
(
viewVo
);
}
}
@Async
public
void
updateIncomeSettleStatus
(
EkpStatusParamVo
vo
)
{
List
<
EkpInsuranceViewVo
>
viewVo
;
//根据结算单号获取明细id和结算状态
//根据结算单号获取明细id和结算状态;判断是管理费还是风险金
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getTypeFlag
()))
{
viewVo
=
ekpSettleService
.
selectIncomelViewBySettleNo
(
vo
.
getSettleNo
());
}
else
{
viewVo
=
ekpSettleService
.
selectFIncomelViewBySettleNo
(
vo
.
getSettleNo
());
}
if
(!
viewVo
.
isEmpty
())
{
socialDaprUtils
.
updateIncomeSettleStatus
(
viewVo
);
}
}
@Async
public
void
updateSalarySettleStatus
(
EkpStatusParamVo
vo
)
{
List
<
EkpSocialViewVo
>
viewVo
;
//根据结算单号获取明细id和结算状态
viewVo
=
ekpSettleService
.
selectSalarylViewBySettleNo
(
vo
.
getSettleNo
(),
vo
.
getPayFlag
());
if
(!
viewVo
.
isEmpty
())
{
viewVo
.
forEach
(
e
->{
e
.
setPayFlag
(
vo
.
getPayFlag
());});
salaryDaprUtil
.
updateSalarySettleStatus
(
viewVo
);
}
}
}
}
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