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
d477a67c
Commit
d477a67c
authored
Aug 29, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
年终奖扣税计算修改
parent
656fb35b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
19 deletions
+59
-19
TStatisticsBonusServiceImpl.java
...yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
+32
-2
TStatisticsDeclarerServiceImpl.java
...u/salary/service/impl/TStatisticsDeclarerServiceImpl.java
+23
-14
TStatisticsDeclarerMapper.xml
...z/src/main/resources/mapper/TStatisticsDeclarerMapper.xml
+4
-3
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsBonusServiceImpl.java
View file @
d477a67c
...
...
@@ -269,13 +269,17 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
sumDeductSalary
=
BigDecimalUtils
.
safeAdd
(
sdSum
,
isTax
,
costReduction
);
//年终奖单独扣税
finalSalaryNoSalary
=
calculationSalary
(
annousTax
,
infoVo
.
getAnnualBonus
());
//年终奖合并扣税
if
(
isSend
)
{
//年终奖单独扣税
finalSalaryNoSalary
=
calculationSalary
(
annousTax
,
infoVo
.
getAnnualBonus
());
wSalary
=
infoVo
.
getAnnualBonus
();
finalSalaryWithSalary
=
finalSalaryNoSalary
;
}
else
{
//年终奖单独扣税
finalSalaryNoSalary
=
calculationSalary
(
annousTax
,
infoVo
.
getAnnualBonus
());
BigDecimal
annualTSalary
=
calculationSalaryT
(
personTax
,
infoVo
.
getAnnualTSalary
(),
sumTax
);
finalSalaryNoSalary
=
BigDecimalUtils
.
safeAdd
(
finalSalaryNoSalary
,
annualTSalary
);
wSalary
=
BigDecimalUtils
.
safeAdd
(
infoVo
.
getAnnualBonus
(),
infoVo
.
getAnnualTSalary
());
finalSalaryWithSalary
=
calculationSalary
(
annousTax
,
wSalary
);
}
...
...
@@ -516,6 +520,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
return
anRes
;
}
/**
* @param personTax 薪资扣税阶梯表list
* @param annualSalary 年终奖
* @Description: 计算薪资扣税-个税
* @Author: huyc
* @Date: 2022/8/23
* @return: java.math.BigDecimal
**/
private
static
BigDecimal
calculationSalaryT
(
List
<
TSalaryTaxConfig
>
personTax
,
BigDecimal
annualSalary
,
BigDecimal
sumTax
)
{
//本次年终奖纳税额
BigDecimal
res
=
BigDecimal
.
ZERO
;
//计算年终奖税
//计算个税
for
(
TSalaryTaxConfig
sub
:
personTax
)
{
if
(
annualSalary
.
compareTo
(
sub
.
getMinIncome
())
==
SalaryConstants
.
MORE_THAN
&&
annualSalary
.
compareTo
(
sub
.
getMaxIncome
())
!=
SalaryConstants
.
MORE_THAN
)
{
//annualSalary = realDeduSalary * ((double) ((annualSalary.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
res
=
annualSalary
.
multiply
(
new
BigDecimal
(
sub
.
getWithholdingRate
()).
divide
(
SalaryConstants
.
B_ONEHUNDRED
,
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
))
.
subtract
(
sumTax
).
subtract
(
sub
.
getQuickDeducation
());
// 应纳税额
break
;
}
}
return
res
;
}
@Override
public
List
<
TStatisticsBonus
>
noPageDiy
(
TStatisticsBonusSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TStatisticsBonus
>
wrapper
=
buildQueryWrapper
(
searchVo
);
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsDeclarerServiceImpl.java
View file @
d477a67c
...
...
@@ -149,16 +149,23 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
@Override
public
R
updateFlagById
(
String
id
,
String
isDeclare
,
String
undeclareReason
)
{
TStatisticsDeclarer
tStatisticsDeclarer
=
baseMapper
.
selectById
(
id
);
if
(
Common
.
isNotNull
(
tStatisticsDeclarer
))
{
tStatisticsDeclarer
.
setIsDeclare
(
isDeclare
);
if
(
Common
.
isNotNull
(
undeclareReason
))
{
tStatisticsDeclarer
.
setUndeclareReason
(
undeclareReason
);
TStatisticsDeclarer
declarerInfo
=
baseMapper
.
selectById
(
id
);
//根据身份证号,姓名和申报月份查找申报人员
List
<
TStatisticsDeclarer
>
declarerList
=
baseMapper
.
selectList
(
Wrappers
.<
TStatisticsDeclarer
>
query
().
lambda
()
.
eq
(
TStatisticsDeclarer:
:
getEmpIdcard
,
declarerInfo
.
getEmpIdcard
())
.
eq
(
TStatisticsDeclarer:
:
getDeclareMonth
,
declarerInfo
.
getDeclareMonth
())
.
eq
(
TStatisticsDeclarer:
:
getEmpName
,
declarerInfo
.
getEmpName
()));
if
(
Common
.
isNotNull
(
declarerList
))
{
for
(
TStatisticsDeclarer
tStatisticsDeclarer:
declarerList
)
{
tStatisticsDeclarer
.
setIsDeclare
(
isDeclare
);
if
(
Common
.
isNotNull
(
undeclareReason
))
{
tStatisticsDeclarer
.
setUndeclareReason
(
undeclareReason
);
}
baseMapper
.
updateById
(
tStatisticsDeclarer
);
}
baseMapper
.
updateById
(
tStatisticsDeclarer
);
return
R
.
ok
();
}
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
@Override
...
...
@@ -274,16 +281,18 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
}
//根据身份证号和申报月份查找申报人员
TStatisticsDeclarer
tStatisticsDeclarer
=
baseMapper
.
selectOne
(
Wrappers
.<
TStatisticsDeclarer
>
query
().
lambda
()
List
<
TStatisticsDeclarer
>
declarerList
=
baseMapper
.
selectList
(
Wrappers
.<
TStatisticsDeclarer
>
query
().
lambda
()
.
eq
(
TStatisticsDeclarer:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TStatisticsDeclarer:
:
getDeclareMonth
,
excel
.
getDeclareMonth
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
tStatisticsDeclarer
))
{
tStatisticsDeclarer
.
setIsDeclare
(
excel
.
getIsDeclare
());
if
(
Common
.
isNotNull
(
excel
.
getUndeclareReason
()))
{
tStatisticsDeclarer
.
setUndeclareReason
(
excel
.
getUndeclareReason
());
.
eq
(
TStatisticsDeclarer:
:
getEmpName
,
excel
.
getEmpName
()));
if
(
Common
.
isNotNull
(
declarerList
))
{
for
(
TStatisticsDeclarer
tStatisticsDeclarer:
declarerList
)
{
tStatisticsDeclarer
.
setIsDeclare
(
excel
.
getIsDeclare
());
if
(
Common
.
isNotNull
(
excel
.
getUndeclareReason
()))
{
tStatisticsDeclarer
.
setUndeclareReason
(
excel
.
getUndeclareReason
());
}
baseMapper
.
updateById
(
tStatisticsDeclarer
);
}
baseMapper
.
updateById
(
tStatisticsDeclarer
);
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"未找到身份证和申报月份对应的申报人员信息"
));
continue
;
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TStatisticsDeclarerMapper.xml
View file @
d477a67c
...
...
@@ -99,11 +99,12 @@
#{nowMonth} DECLARE_MONTH,c.EMP_NAME,c.EMP_IDCARD,c.EMP_PHONE,c.INVOICE_TITLE DECLARE_UNIT,
if(c.FORM_TYPE=0,'0',if(c.FORM_TYPE=3 or c.FORM_TYPE=4,'1','-')) OCCUPATION_TYPE FROM
(SELECT s.* FROM t_salary_account s,
(SELECT a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE,a.FORM_TYPE,MAX(CREATE_TIME) max_day,a.SETTLEMENT_MONTH
(SELECT a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE,a.FORM_TYPE,MAX(CREATE_TIME) max_day,a.SETTLEMENT_MONTH,
if(a.FORM_TYPE=0,'0',if(a.FORM_TYPE=3 or a.FORM_TYPE=4,'1','-')) CUPATION_TYPE
FROM t_salary_account a WHERE a.DELETE_FLAG = '0' AND a.SETTLEMENT_MONTH = #{lastMonth}
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,
a.FORM
_TYPE,a.SETTLEMENT_MONTH) b
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,
CUPATION
_TYPE,a.SETTLEMENT_MONTH) b
WHERE s.DELETE_FLAG = '0' AND b.max_day = s.CREATE_TIME
AND s.EMP_IDCARD = b.EMP_IDCARD AND s.INVOICE_TITLE = b.INVOICE_TITLE
AND s.SETTLEMENT_MONTH = b.SETTLEMENT_MONTH
AND s.FORM_TYPE = b.FORM_TYPE
) c
AND s.SETTLEMENT_MONTH = b.SETTLEMENT_MONTH) c
</select>
</mapper>
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