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
3e7a814e
Commit
3e7a814e
authored
Nov 10, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
劳务费导入接口修改
parent
ff9d71c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
33 deletions
+40
-33
SalaryUploadServiceImpl.java
.../v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
+28
-19
TStatisticsBonusServiceImpl.java
...yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
+12
-14
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
View file @
3e7a814e
...
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
...
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
...
@@ -995,10 +996,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -995,10 +996,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
||
SalaryConstants
.
ENTERPRISE_ANNUITY_JAVA
.
equals
(
item
.
getJavaFiedName
())
||
SalaryConstants
.
ENTERPRISE_ANNUITY_JAVA
.
equals
(
item
.
getJavaFiedName
())
||
SalaryConstants
.
WITHHOLIDING_PERSON_SOCIAL
.
equals
(
item
.
getJavaFiedName
())
||
SalaryConstants
.
WITHHOLIDING_PERSON_SOCIAL
.
equals
(
item
.
getJavaFiedName
())
||
SalaryConstants
.
WITHHOLIDING_PERSON_FUND
.
equals
(
item
.
getJavaFiedName
()))
{
||
SalaryConstants
.
WITHHOLIDING_PERSON_FUND
.
equals
(
item
.
getJavaFiedName
()))
{
sum
=
sum
.
add
(
item
.
getSalaryMoney
()).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
sum
=
sum
.
add
(
item
.
getSalaryMoney
()).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
}
}
}
sum
=
realSalary
.
subtract
(
sum
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
sum
=
realSalary
.
subtract
(
sum
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
if
(
sum
.
compareTo
(
SalaryConstants
.
B_ZERO
)
<
SalaryConstants
.
EQUAL
)
{
if
(
sum
.
compareTo
(
SalaryConstants
.
B_ZERO
)
<
SalaryConstants
.
EQUAL
)
{
sum
=
SalaryConstants
.
B_ZERO
;
sum
=
SalaryConstants
.
B_ZERO
;
}
}
...
@@ -1104,7 +1105,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1104,7 +1105,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
**/
**/
private
BigDecimal
getSocialFundMoney
(
TSalaryAccount
a
,
List
<
TPaymentBySalaryVo
>
estmateList
,
boolean
isSocial
private
BigDecimal
getSocialFundMoney
(
TSalaryAccount
a
,
List
<
TPaymentBySalaryVo
>
estmateList
,
boolean
isSocial
,
boolean
isPerson
,
Set
<
String
>
socialList
,
Set
<
String
>
fundList
,
BigDecimal
money
,
BigDecimal
sub
)
{
,
boolean
isPerson
,
Set
<
String
>
socialList
,
Set
<
String
>
fundList
,
BigDecimal
money
,
BigDecimal
sub
)
{
money
=
money
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
money
=
money
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
for
(
TPaymentBySalaryVo
m
:
estmateList
)
{
for
(
TPaymentBySalaryVo
m
:
estmateList
)
{
if
(
Common
.
isNotNull
(
a
.
getEmpIdcard
())
&&
a
.
getEmpIdcard
().
equals
(
m
.
getEmpIdcard
()))
{
if
(
Common
.
isNotNull
(
a
.
getEmpIdcard
())
&&
a
.
getEmpIdcard
().
equals
(
m
.
getEmpIdcard
()))
{
//社保
//社保
...
@@ -1276,7 +1277,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1276,7 +1277,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if
(
res
.
compareTo
(
SalaryConstants
.
B_ZERO
)
<
SalaryConstants
.
EQUAL
)
{
if
(
res
.
compareTo
(
SalaryConstants
.
B_ZERO
)
<
SalaryConstants
.
EQUAL
)
{
return
SalaryConstants
.
B_ZERO
;
return
SalaryConstants
.
B_ZERO
;
}
}
res
=
res
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
res
=
res
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
a
.
setSalaryTax
(
res
);
a
.
setSalaryTax
(
res
);
return
res
;
return
res
;
}
}
...
@@ -1340,12 +1341,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1340,12 +1341,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
)),
new
BigDecimal
(
"7000"
))
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
)),
new
BigDecimal
(
"7000"
))
,
new
BigDecimal
(
"0.68"
));
,
new
BigDecimal
(
"0.68"
));
}
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTax
=
BigDecimalUtils
.
safeSubtract
(
nowTax
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTax
=
BigDecimalUtils
.
safeSubtract
(
nowTax
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
}
BigDecimal
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
BigDecimal
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
// 本次个人应发合计
// 本次个人应发合计
TSalaryAccountItem
sai
=
new
TSalaryAccountItem
();
TSalaryAccountItem
sai
=
new
TSalaryAccountItem
();
sai
.
setCnName
(
SalaryConstants
.
RELAY_SALARY
);
sai
.
setCnName
(
SalaryConstants
.
RELAY_SALARY
);
...
@@ -1656,6 +1657,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1656,6 +1657,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
// 历史个税合计
// 历史个税合计
BigDecimal
sumTax
=
BigDecimal
.
ZERO
;
BigDecimal
sumTax
=
BigDecimal
.
ZERO
;
// 个人承担部分历史个税合计
BigDecimal
sumOtherTax
;
// 历史应发合计
// 历史应发合计
BigDecimal
sumSalaryTax
=
BigDecimal
.
ZERO
;
BigDecimal
sumSalaryTax
=
BigDecimal
.
ZERO
;
// 本次实发
// 本次实发
...
@@ -1686,29 +1689,35 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1686,29 +1689,35 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if
(
SalaryConstants
.
IS_PERSON_OTHER
.
equals
(
a
.
getIsPersonTax
()))
{
if
(
SalaryConstants
.
IS_PERSON_OTHER
.
equals
(
a
.
getIsPersonTax
()))
{
nowTaxT
=
getNowTax
(
actualSalarySumNow
);
nowTaxT
=
getNowTax
(
actualSalarySumNow
);
if
(
actualSalarySum
.
compareTo
(
actualSalarySumNow
)
!=
0
)
{
if
(
actualSalarySum
.
compareTo
(
actualSalarySumNow
)
!=
0
)
{
actualSalarySumT
=
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumSalaryTax
,
actualSalarySumNow
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
//计算历史税费
sumOtherTax
=
getNowTaxNew
(
sumSalaryTax
);
//计算本月实发合计
actualSalarySumT
=
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumSalaryTax
,
actualSalarySumNow
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
//累计税费
nowTaxY
=
getNowTaxNew
(
actualSalarySumT
);
nowTaxY
=
getNowTaxNew
(
actualSalarySumT
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
if
(
sum
Other
Tax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sum
Tax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sum
OtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
}
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
nowTaxT
);
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
nowTaxT
);
}
else
{
}
else
{
nowTaxY
=
nowTaxT
;
nowTaxY
=
nowTaxT
;
}
}
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
//公司应发
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
a
.
setSalaryTax
(
salaryTax
);
a
.
setSalaryTax
(
salaryTax
);
a
.
setSalaryTaxUnit
(
nowTaxT
);
a
.
setSalaryTaxUnit
(
nowTaxT
);
a
.
setActualSalary
(
BigDecimalUtils
.
safeSubtract
(
actualSalarySumNow
,
salaryTax
));
a
.
setActualSalary
(
BigDecimalUtils
.
safeSubtract
(
actualSalarySumNow
,
salaryTax
));
}
else
if
(
SalaryConstants
.
IS_COMPANY
.
equals
(
a
.
getIsPersonTax
()))
{
}
else
if
(
SalaryConstants
.
IS_COMPANY
.
equals
(
a
.
getIsPersonTax
()))
{
getNowTax
(
actualSalarySumNow
);
nowTaxY
=
getNowTax
(
actualSalarySum
);
nowTaxY
=
getNowTax
(
actualSalarySum
);
a
.
setActualSalary
(
actualSalarySumNow
);
a
.
setActualSalary
(
actualSalarySumNow
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
if
(
sumSalaryTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
//历史应发税费
sumOtherTax
=
getNowTax
(
sumSalaryTax
);
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumOtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
}
a
.
setSalaryTaxUnit
(
nowTaxY
);
a
.
setSalaryTaxUnit
(
nowTaxY
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxY
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxY
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
else
{
}
else
{
// TODO-@胡 :个人承担全部税费,实发要变为应发,推算出实发、个税
// TODO-@胡 :个人承担全部税费,实发要变为应发,推算出实发、个税
...
@@ -1753,7 +1762,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1753,7 +1762,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
)),
new
BigDecimal
(
"7000"
))
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
)),
new
BigDecimal
(
"7000"
))
,
new
BigDecimal
(
"0.68"
));
,
new
BigDecimal
(
"0.68"
));
}
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
return
nowTax
;
return
nowTax
;
}
}
...
@@ -1776,7 +1785,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1776,7 +1785,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
nowTax
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
))
nowTax
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
))
,
new
BigDecimal
(
"7000"
));
,
new
BigDecimal
(
"7000"
));
}
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
return
nowTax
;
return
nowTax
;
}
}
...
@@ -1930,7 +1939,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1930,7 +1939,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//个人税费
//个人税费
BigDecimal
nowTaxT
=
getNowTaxRemu
(
actualSalarySumNow
);
BigDecimal
nowTaxT
=
getNowTaxRemu
(
actualSalarySumNow
);
BigDecimal
relaySalary
;
BigDecimal
relaySalary
;
relaySalary
=
BigDecimalUtils
.
safeSubtract
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
relaySalary
=
BigDecimalUtils
.
safeSubtract
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
a
.
setSalaryTax
(
nowTaxT
);
a
.
setSalaryTax
(
nowTaxT
);
a
.
setActualSalary
(
relaySalary
);
a
.
setActualSalary
(
relaySalary
);
a
.
setRelaySalaryUnit
(
actualSalarySumNow
);
a
.
setRelaySalaryUnit
(
actualSalarySumNow
);
...
@@ -1957,7 +1966,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1957,7 +1966,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//x*0.16*0.7
//x*0.16*0.7
nowTax
=
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.112"
));
nowTax
=
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.112"
));
}
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
return
nowTax
;
return
nowTax
;
}
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
View file @
3e7a814e
...
@@ -55,6 +55,7 @@ import javax.servlet.ServletOutputStream;
...
@@ -55,6 +55,7 @@ import javax.servlet.ServletOutputStream;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -200,7 +201,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
...
@@ -200,7 +201,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TStatisticsBonusImportVo
.
class
).
build
();
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TStatisticsBonusImportVo
.
class
).
build
();
int
index
=
0
;
//个税配置
//个税配置
List
<
TSalaryTaxConfig
>
personTax
=
tSalaryTaxConfigService
.
getTaxConfigByPersonList
(
new
TSalaryTaxConfig
());
List
<
TSalaryTaxConfig
>
personTax
=
tSalaryTaxConfigService
.
getTaxConfigByPersonList
(
new
TSalaryTaxConfig
());
//年终奖配置
//年终奖配置
...
@@ -245,13 +245,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
...
@@ -245,13 +245,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
isTax
=
BigDecimal
.
ZERO
;
isTax
=
BigDecimal
.
ZERO
;
twlSalaryTax
=
BigDecimal
.
ZERO
;
twlSalaryTax
=
BigDecimal
.
ZERO
;
//12月是否发薪
//12月是否发薪
B
oolean
isSend
=
false
;
b
oolean
isSend
=
false
;
//年终奖单独扣税12月税费
//年终奖单独扣税12月税费
finalSalaryNoSalary
=
BigDecimal
.
ZERO
;
finalSalaryNoSalary
=
BigDecimal
.
ZERO
;
//年终奖合并扣税12月税费
//年终奖合并扣税12月税费
finalSalaryWithSalary
=
BigDecimal
.
ZERO
;
finalSalaryWithSalary
=
BigDecimal
.
ZERO
;
//12月份应纳税所得额扣除费用
//12月份应纳税所得额扣除费用
BigDecimal
deductTaxSalary
=
infoVo
.
getDeductTaxSalary
();
//12月社保公积金扣费
//12月社保公积金扣费
socialFundTax
=
BigDecimal
.
ZERO
;
socialFundTax
=
BigDecimal
.
ZERO
;
//专项扣除列表
//专项扣除列表
...
@@ -523,30 +522,29 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
...
@@ -523,30 +522,29 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
//本次薪资纳税额
//本次薪资纳税额
res
=
BigDecimal
.
ZERO
;
res
=
BigDecimal
.
ZERO
;
//本次年终奖纳税额
//本次年终奖纳税额
anRes
=
BigDecimal
.
ZERO
;
;
anRes
=
BigDecimal
.
ZERO
;
//年终奖金额
//年终奖金额
BigDecimal
annous
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
i
);
BigDecimal
annous
=
BigDecimalUtils
.
safeSubtract
(
wSalary
,
i
);
//计算个税
//计算个税
if
(
i
.
compareTo
(
BigDecimal
.
ZERO
)
==
SalaryConstants
.
MORE_THAN
)
{
if
(
i
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimal
sumI
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
i
,
ySalary
),
BigDecimal
sumI
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeAdd
(
i
,
ySalary
),
BigDecimalUtils
.
safeAdd
(
sumDeductSalary
));
BigDecimalUtils
.
safeAdd
(
sumDeductSalary
));
for
(
TSalaryTaxConfig
sub
:
personTax
)
{
for
(
TSalaryTaxConfig
sub
:
personTax
)
{
if
(
sumI
.
compareTo
(
sub
.
getMinIncome
())
==
SalaryConstants
.
MORE_THAN
if
(
sumI
.
compareTo
(
sub
.
getMinIncome
())
>
0
&&
sumI
.
compareTo
(
sub
.
getMaxIncome
())
!=
SalaryConstants
.
MORE_THAN
)
{
&&
sumI
.
compareTo
(
sub
.
getMaxIncome
())
!=
SalaryConstants
.
MORE_THAN
)
{
//sumI = realDeduSalary * ((double) ((i.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
//累计个税
//累计个税
res
=
BigDecimalUtils
.
safeSubtract
(
sumI
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
res
=
BigDecimalUtils
.
safeSubtract
(
sumI
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
)),
sub
.
getQuickDeducation
());
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
)),
sub
.
getQuickDeducation
());
//本次个税
//本次个税
BigDecimal
bcTax
=
res
.
subtract
(
BigDecimalUtils
.
safeAdd
(
sumTax
,
twlSalaryTax
));
BigDecimal
bcTax
=
res
.
subtract
(
BigDecimalUtils
.
safeAdd
(
sumTax
,
twlSalaryTax
));
if
(
bcTax
.
compareTo
(
BigDecimal
.
ZERO
)
==
SalaryConstants
.
MORE_THAN
||
if
(
bcTax
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
||
bcTax
.
compareTo
(
BigDecimal
.
ZERO
)
==
SalaryConstants
.
EQUAL
)
{
bcTax
.
compareTo
(
BigDecimal
.
ZERO
)
==
SalaryConstants
.
EQUAL
)
{
res
=
BigDecimalUtils
.
safeAdd
(
bcTax
,
twlSalaryTax
);
res
=
BigDecimalUtils
.
safeAdd
(
bcTax
,
twlSalaryTax
);
}
else
{
}
else
{
res
=
BigDecimalUtils
.
safeAdd
(
twlSalaryTax
,
sumTax
);
res
=
BigDecimalUtils
.
safeAdd
(
twlSalaryTax
,
sumTax
);
}
}
res
=
BigDecimalUtils
.
safeSubtract
(
sumI
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
res
=
BigDecimalUtils
.
safeSubtract
(
sumI
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_
HALF_UP
)),
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
)),
BigDecimalUtils
.
safeAdd
(
sumTax
,
sub
.
getQuickDeducation
()));
BigDecimalUtils
.
safeAdd
(
sumTax
,
sub
.
getQuickDeducation
()));
break
;
break
;
}
}
...
@@ -556,15 +554,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
...
@@ -556,15 +554,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}
//计算年终奖税
//计算年终奖税
//年终奖
//年终奖
if
(
annous
!=
null
&&
annous
.
compareTo
(
SalaryConstants
.
B_ZERO
)
==
SalaryConstants
.
MORE_THAN
if
(
annous
!=
null
&&
annous
.
compareTo
(
SalaryConstants
.
B_ZERO
)
>
0
&&
annousTax
!=
null
&&
annousTax
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
&&
annousTax
!=
null
&&
annousTax
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
BigDecimal
month
=
annous
.
divide
(
SalaryConstants
.
B_TWELVE
,
SalaryConstants
.
TAX_FEE_PLACES
,
BigDecimal
.
ROUND_
HALF_UP
);
BigDecimal
month
=
annous
.
divide
(
SalaryConstants
.
B_TWELVE
,
SalaryConstants
.
TAX_FEE_PLACES
,
RoundingMode
.
HALF_UP
);
// 应纳税额
// 应纳税额
for
(
TSalaryTaxConfig
sub
:
annousTax
)
{
for
(
TSalaryTaxConfig
sub
:
annousTax
)
{
if
(
month
.
compareTo
(
sub
.
getMinIncome
())
==
SalaryConstants
.
MORE_THAN
if
(
month
.
compareTo
(
sub
.
getMinIncome
())
>
0
&&
month
.
compareTo
(
sub
.
getMaxIncome
())
!=
SalaryConstants
.
MORE_THAN
)
{
&&
month
.
compareTo
(
sub
.
getMaxIncome
())
!=
SalaryConstants
.
MORE_THAN
)
{
anRes
=
annous
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
anRes
=
annous
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
TAX_FEE_PLACES
,
BigDecimal
.
ROUND_
HALF_UP
))
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
TAX_FEE_PLACES
,
RoundingMode
.
HALF_UP
))
.
subtract
(
sub
.
getQuickDeducation
());
.
subtract
(
sub
.
getQuickDeducation
());
break
;
break
;
}
}
...
...
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