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
6221c062
Commit
6221c062
authored
Sep 14, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成收入接口修改
parent
040161f4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
70 deletions
+136
-70
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+136
-69
TIncomeServiceImpl.java
.../plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
+0
-1
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 @
6221c062
...
...
@@ -1431,6 +1431,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
BigDecimal
actualMoney
;
actualMoney
=
detail
.
getActualPremium
();
if
(
StringUtils
.
isNotBlank
(
success
.
getInvoiceNo
())){
detail
.
setInvoiceNo
(
success
.
getInvoiceNo
());
//如果发票号不为空,将替换类型的发票号也全部更新
...
...
@@ -1625,27 +1627,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this
.
updateById
(
detail
);
detailList
.
add
(
detail
);
try
{
if
(
detail
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
)
{
if
(
new
BigDecimal
(
success
.
getActualPremium
()).
compareTo
(
detail
.
getActualPremium
())
!=
0
)
{
//判断是否存在当月的商险收入数据
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
detail
.
getId
());
R
<
TIncomeDetailReturnVo
>
detailInfoList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailInfoList
)
&&
detailInfoList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
detailInfoList
.
getData
().
getDetailList
().
size
()
>
0
)
{
//生成红冲数据
for
(
TIncomeDetail
detailInfo
:
detailInfoList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detailInfo
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detailInfo
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detailInfo
);
}
}
//生成收入数据
createInsuranceInfo
(
detail
);
}
else
{
if
(
detail
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
&&
CommonConstants
.
ONE_INT
==
detail
.
getSettleType
())
{
if
(
new
BigDecimal
(
success
.
getActualPremium
()).
compareTo
(
actualMoney
)
!=
0
)
{
//获取项目信息
TSettleDomain
settleDomain
=
new
TSettleDomain
();
List
<
TSettleDomainSelectVo
>
settleDomainR
=
null
;
...
...
@@ -1666,39 +1650,77 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 含有商险,则计算收入
if
(
settleDomain
.
getMrSettleType
().
equals
(
CommonConstants
.
TWO_STRING
))
{
if
(
Common
.
isNotNull
(
settleDomain
.
getManageServerItem
())
&&
settleDomain
.
getManageServerItem
()
.
contains
(
CommonConstants
.
THREE_STRING
))
{
.
contains
(
CommonConstants
.
THREE_STRING
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
())
)
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
BigDecimalUtils
.
safeMultiply
(
detail
.
getActualPremium
()
,
gMoney
=
BigDecimalUtils
.
safeMultiply
(
actualMoney
,
settleDomain
.
getManagementFee
().
divide
(
new
BigDecimal
(
"100"
),
CommonConstants
.
FIVE_INT
,
BigDecimal
.
ROUND_HALF_UP
));
isBl
=
true
;
}
}
else
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
settleDomain
.
getRiskServerItem
()
.
contains
(
CommonConstants
.
THREE_STRING
))
{
//判断是否存在当月的商险收入数据
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
detail
.
getId
());
if
(
isBl
)
{
incomeDetail
.
setMoney
(
gMoney
);
}
else
{
incomeDetail
.
setMoney
(
actualMoney
);
}
incomeDetail
.
setFeeType
(
CommonConstants
.
ONE_STRING
);
//判断是否存在当月的商险收入数据
R
<
TIncomeDetailReturnVo
>
detailInfoList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailInfoList
)
&&
detailInfoList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
detailInfoList
.
getData
().
getDetailList
().
size
()
>
0
)
{
//生成红冲数据
for
(
TIncomeDetail
detailInfo
:
detailInfoList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detailInfo
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detailInfo
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detail1
);
break
;
}
}
}
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
settleDomain
.
getRiskServerItem
()
.
contains
(
CommonConstants
.
THREE_STRING
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
gMoney
=
BigDecimalUtils
.
safeMultiply
(
detail
.
getActualPremium
()
,
gMoney
=
BigDecimalUtils
.
safeMultiply
(
actualMoney
,
settleDomain
.
getRiskFundFee
().
divide
(
new
BigDecimal
(
"100"
),
CommonConstants
.
FIVE_INT
,
BigDecimal
.
ROUND_HALF_UP
));
isBl
=
true
;
}
}
}
}
//判断是否存在当月的商险收入数据
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setSourceId
(
detail
.
getId
());
incomeDetail
.
setFeeType
(
CommonConstants
.
TWO_STRING
);
if
(
isBl
)
{
incomeDetail
.
setMoney
(
gMoney
);
}
else
{
incomeDetail
.
setMoney
(
detail
.
getActualPremium
()
);
incomeDetail
.
setMoney
(
actualMoney
);
}
//判断是否存在当月的商险收入数据
R
<
TIncomeDetailReturnVo
>
detailInfoList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailInfoList
)
&&
detailInfoList
.
getData
().
getDetailList
().
size
()
==
0
)
{
if
(
Common
.
isNotNull
(
detailInfoList
)
&&
detailInfoList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
detailInfoList
.
getData
().
getDetailList
().
size
()
>
0
)
{
//生成红冲数据
for
(
TIncomeDetail
detailInfo
:
detailInfoList
.
getData
().
getDetailList
())
{
TIncomeDetail
detail1
=
new
TIncomeDetail
();
BeanCopyUtils
.
copyProperties
(
detailInfo
,
detail1
);
detail1
.
setId
(
CommonConstants
.
NULL
);
detail1
.
setRedData
(
CommonConstants
.
ONE_STRING
);
detail1
.
setMoney
(
detailInfo
.
getMoney
().
negate
());
socialDaprUtils
.
createTIncomeDetail
(
detail1
);
break
;
}
}
}
}
}
//生成收入数据
createInsuranceInfo
(
detail
);
}
}
}
}
catch
(
Exception
e
){
log
.
error
(
"收入数据同步处理失败:"
+
e
);
}
...
...
@@ -6074,6 +6096,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//判断是否存在当月的商险收入数据
Boolean
isExist
=
false
;
List
<
TIncomeDetail
>
incomeDetailList
=
new
ArrayList
<>();
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setEmpIdcard
(
insuranceDetail
.
getEmpIdcardNo
());
incomeDetail
.
setCreateMonth
(
DateUtil
.
getYearAndMonth
(
insuranceDetail
.
getHandledTime
(),
0
));
...
...
@@ -6082,15 +6105,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
R
<
TIncomeDetailReturnVo
>
detailList
=
socialDaprUtils
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
)
&&
detailList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
detailList
.
getData
().
getDetailList
().
size
()
>
0
){
incomeDetailList
=
detailList
.
getData
().
getDetailList
();
isExist
=
true
;
}
//预估或者实缴保费
BigDecimal
fee
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceDetail
.
getSettleType
()))
{
fee
=
insuranceDetail
.
getEstimatePremium
();
}
else
{
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getSettleType
())
{
fee
=
insuranceDetail
.
getActualPremium
();
}
else
{
fee
=
insuranceDetail
.
getEstimatePremium
();
}
//判断是否为按人次收费
...
...
@@ -6104,7 +6128,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
//预估模式只有按人次和人数收费
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
if
(
Common
.
isNotNull
(
incomeDetailList
))
{
for
(
TIncomeDetail
incomeDetailSum:
incomeDetailList
)
{
if
(!(
incomeDetailSum
.
getSourceId
().
equals
(
insuranceDetail
.
getId
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
incomeDetailSum
.
getFeeType
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
incomeDetailSum
.
getMrSettleType
())))
{
isSum
=
1
;
break
;
}
}
}
}
if
(!
isExist
||
isSum
==
1
)
{
createIncomeInsurance
(
insuranceDetail
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
...
...
@@ -6112,12 +6145,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settleDomain
.
getManagementFee
());
}
}
else
{
BigDecimal
gMoney
=
BigDecimal
.
ZERO
;
BigDecimal
gMoney
;
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
if
(
Common
.
isNotNull
(
incomeDetailList
))
{
for
(
TIncomeDetail
incomeDetailSum:
incomeDetailList
)
{
if
(
incomeDetailSum
.
getSourceId
().
equals
(
insuranceDetail
.
getId
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
incomeDetailSum
.
getFeeType
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
incomeDetailSum
.
getMrSettleType
())
&&
CommonConstants
.
THREE_STRING
.
equals
(
incomeDetailSum
.
getFeeMode
()))
{
isSum
=
6
;
break
;
}
else
{
isSum
=
2
;
}
}
}
}
else
{
isSum
=
2
;
gMoney
=
BigDecimalUtils
.
safeMultiply
(
fee
,
settleDomain
.
getManagementFee
().
divide
(
...
...
@@ -6133,10 +6178,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
settleDomain
.
getRiskServerItem
()
.
contains
(
CommonConstants
.
THREE_STRING
))
{
//预估模式
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
if
(
Common
.
isNotNull
(
incomeDetailList
))
{
for
(
TIncomeDetail
incomeDetailSum:
incomeDetailList
)
{
if
(!(
incomeDetailSum
.
getSourceId
().
equals
(
insuranceDetail
.
getId
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
incomeDetailSum
.
getFeeType
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
incomeDetailSum
.
getMrSettleType
())))
{
isSum
=
3
;
break
;
}
}
}
}
if
(!
isExist
||
isSum
==
3
)
{
createIncomeInsurance
(
insuranceDetail
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
...
...
@@ -6145,12 +6199,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
else
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
BigDecimal
money
=
BigDecimal
.
ZERO
;
BigDecimal
money
;
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
if
(
Common
.
isNotNull
(
incomeDetailList
))
{
for
(
TIncomeDetail
incomeDetailSum:
incomeDetailList
)
{
if
(
incomeDetailSum
.
getSourceId
().
equals
(
insuranceDetail
.
getId
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
incomeDetailSum
.
getFeeType
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
incomeDetailSum
.
getMrSettleType
())
&&
CommonConstants
.
THREE_STRING
.
equals
(
incomeDetailSum
.
getFeeMode
()))
{
isSum
=
5
;
break
;
}
else
{
isSum
=
4
;
}
}
}
}
else
{
isSum
=
4
;
money
=
BigDecimalUtils
.
safeMultiply
(
fee
,
settleDomain
.
getRiskFundFee
().
divide
(
...
...
@@ -6165,6 +6231,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
public
void
createIncomeInsurance
(
TInsuranceDetail
insuranceDetail
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
)
{
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
View file @
6221c062
...
...
@@ -310,7 +310,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income
.
setSendStatus
(
CommonConstants
.
ONE_STRING
);
income
.
setSendMonth
(
DateUtil
.
addMonth
(
0
));
income
.
setEkpId
(
sendBack
);
income
.
setId
(
CommonConstants
.
NULL
);
}
else
{
if
(
map
.
get
(
sendBack
)
>
0
)
{
int
i
=
map
.
get
(
sendBack
)
+
1
;
...
...
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