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
d8a37730
Commit
d8a37730
authored
Nov 28, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
2423d690
4f7aa894
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
51 deletions
+17
-51
TStatisticsBonusServiceImpl.java
...yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
+17
-51
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
View file @
d8a37730
...
...
@@ -354,16 +354,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal
oneBecimal
=
new
BigDecimal
(
"36000"
);
BigDecimal
twoBecimal
=
new
BigDecimal
(
"144000"
);
BigDecimal
subOneBecimal
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
oneBecimal
);
BigDecimal
subTwoBecimal
1
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
twoBecimal
);
BigDecimal
subTwoBecimal
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
twoBecimal
);
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
oneBecimal
)
<=
0
)
{
if
(
wSalary
.
compareTo
(
oneBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -371,16 +368,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subOneBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subOneBecimal
:
socialFundTax
;
}
maxAnualSalary
=
oneBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"72000"
))
<=
0
)
{
if
(
wSalary
.
compareTo
(
oneBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -388,16 +381,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subOneBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subOneBecimal
:
socialFundTax
;
}
maxAnualSalary
=
oneBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"203100"
))
<=
0
)
{
if
(
wSalary
.
compareTo
(
oneBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -405,52 +394,40 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subOneBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subOneBecimal
:
socialFundTax
;
}
maxAnualSalary
=
oneBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"288000"
))
<=
0
)
{
if
(
wSalary
.
compareTo
(
twoBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
minSalary
=
subTwoBecimal
1
;
minSalary
=
subTwoBecimal
;
}
else
{
minSalary
=
subTwoBecimal
1
.
compareTo
(
socialFundTax
)
>
0
?
subTwoBecimal1
:
socialFundTax
;
minSalary
=
subTwoBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subTwoBecimal
:
socialFundTax
;
}
maxAnualSalary
=
twoBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"672000"
))
<=
0
)
{
if
(
wSalary
.
compareTo
(
twoBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
minSalary
=
subTwoBecimal
1
;
minSalary
=
subTwoBecimal
;
}
else
{
minSalary
=
subTwoBecimal
1
.
compareTo
(
socialFundTax
)
>
0
?
subTwoBecimal1
:
socialFundTax
;
minSalary
=
subTwoBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subTwoBecimal
:
socialFundTax
;
}
maxAnualSalary
=
twoBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"1277500"
))
<=
0
)
{
BigDecimal
threeBecimal
=
new
BigDecimal
(
"300000"
);
BigDecimal
subThreeBecimal
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
threeBecimal
);
if
(
wSalary
.
compareTo
(
threeBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -458,18 +435,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subThreeBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subThreeBecimal
:
socialFundTax
;
}
maxAnualSalary
=
threeBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"1452500"
))
<=
0
)
{
BigDecimal
fourBecimal
=
new
BigDecimal
(
"420000"
);
BigDecimal
subFourBecimal
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
fourBecimal
);
if
(
wSalary
.
compareTo
(
fourBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -477,18 +450,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subFourBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subFourBecimal
:
socialFundTax
;
}
maxAnualSalary
=
fourBecimal
;
}
}
else
if
(
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
ySalary
,
wSalary
),
sumDeductSalary
).
compareTo
(
new
BigDecimal
(
"1452500"
))
>
0
)
{
BigDecimal
fiveBecimal
=
new
BigDecimal
(
"660000"
);
BigDecimal
subFiveBecimal
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
fiveBecimal
);
if
(
wSalary
.
compareTo
(
fiveBecimal
)
<=
0
)
{
if
(
isSend
)
{
maxAnualSalary
=
wSalary
;
}
else
{
if
(!
isSend
)
{
minSalary
=
socialFundTax
;
maxAnualSalary
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
socialFundTax
);
}
}
else
{
if
(
isSend
)
{
...
...
@@ -496,12 +465,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
else
{
minSalary
=
subFiveBecimal
.
compareTo
(
socialFundTax
)
>
0
?
subFiveBecimal
:
socialFundTax
;
}
maxAnualSalary
=
fiveBecimal
;
}
}
JSONObject
jsonObject
=
calculationPersonSalary
(
personTax
,
annousTax
,
minSalary
,
maxAnualSalary
,
wSalary
,
sumTax
,
ySalary
,
sumDeductSalary
,
twlSalaryTax
);
JSONObject
jsonObject
=
calculationPersonSalary
(
personTax
,
annousTax
,
minSalary
,
wSalary
,
sumTax
,
ySalary
,
sumDeductSalary
,
twlSalaryTax
);
res
=
jsonObject
.
getBigDecimal
(
"zySalary"
);
BigDecimal
anRes
=
BigDecimal
.
ZERO
;
if
(
Common
.
isNotNull
(
jsonObject
.
getBigDecimal
(
"anRes"
)))
{
...
...
@@ -535,7 +503,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
* @param personTax 薪资扣税阶梯表list
* @param annousTax 年终奖扣税阶梯表list
* @param minSalary 工资下限
* @param maxAnualSalary 年终奖上限
* @param wSalary 未发金额
* @param ySalary 应发工资合计
* @param sumTax 薪资扣税合计
...
...
@@ -546,15 +513,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
* @return: java.math.BigDecimal
**/
private
static
JSONObject
calculationPersonSalary
(
List
<
TSalaryTaxConfig
>
personTax
,
List
<
TSalaryTaxConfig
>
annousTax
,
BigDecimal
minSalary
,
BigDecimal
maxAnualSalary
,
BigDecimal
wSalary
,
BigDecimal
sumTax
,
BigDecimal
ySalary
,
BigDecimal
minSalary
,
BigDecimal
wSalary
,
BigDecimal
sumTax
,
BigDecimal
ySalary
,
BigDecimal
sumDeductSalary
,
BigDecimal
twlSalaryTax
)
{
JSONObject
jsonObject
=
new
JSONObject
();
BigDecimal
anRes
;
BigDecimal
res
;
List
<
BigDecimal
>
zySalary
=
new
ArrayList
<>();
Map
<
String
,
BigDecimal
>
map
=
new
HashMap
<>();
for
(
BigDecimal
i
=
minSalary
;
i
.
compareTo
(
maxAnual
Salary
)
<=
0
;
i
=
BigDecimalUtils
.
safeAdd
(
i
,
new
BigDecimal
(
100
))
)
{
for
(
BigDecimal
i
=
minSalary
;
i
.
compareTo
(
w
Salary
)
<=
0
;
i
=
BigDecimalUtils
.
safeAdd
(
i
,
new
BigDecimal
(
100
))
)
{
//本次薪资纳税额
res
=
BigDecimal
.
ZERO
;
//本次年终奖纳税额
...
...
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