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
cf2573cc
Commit
cf2573cc
authored
Nov 15, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
cc5022a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
34 deletions
+19
-34
SalaryUploadServiceImpl.java
.../v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
+19
-34
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
View file @
cf2573cc
...
...
@@ -1531,10 +1531,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryAccountItem
sai
;
for
(
int
i
=
CommonConstants
.
ZERO_INT
;
i
<
size
;
i
++)
{
a
=
new
TSalaryAccount
();
// 本次实发
BigDecimal
actualSalarySumNow
=
BigDecimal
.
ZERO
;
// 当月实发合计
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
try
{
SalaryAccountUtil
.
reflectionAttr
(
savList
.
get
(
i
),
a
);
if
(!
haveSalaryFlag
&&
a
.
getHaveSalaryFlag
()
!=
null
&&
a
.
getHaveSalaryFlag
()
==
CommonConstants
.
ONE_INT
)
{
...
...
@@ -1549,11 +1545,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
for
(
int
j
=
0
;
j
<
savList
.
get
(
i
).
getSaiList
().
size
();
j
++)
{
sai
=
new
TSalaryAccountItem
();
SalaryAccountUtil
.
reflectionAttr
(
savList
.
get
(
i
).
getSaiList
().
get
(
j
),
sai
);
//个人实发合计
if
(
SalaryConstants
.
ACTUAL_SALARY_SUM_JAVA
.
equals
(
sai
.
getJavaFiedName
()))
{
actualSalarySum
=
actualSalarySum
.
add
(
sai
.
getSalaryMoney
());
actualSalarySumNow
=
actualSalarySumNow
.
add
(
sai
.
getSalaryMoney
());
}
saiList
.
add
(
sai
);
}
}
...
...
@@ -1645,7 +1636,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private
static
BigDecimal
calculationLabor
(
List
<
TSalaryAccountItem
>
itemList
,
List
<
TSalaryAccountItem
>
itemHistoryList
,
private
BigDecimal
calculationLabor
(
List
<
TSalaryAccountItem
>
itemList
,
List
<
TSalaryAccountItem
>
itemHistoryList
,
List
<
TSalaryAccountItem
>
saiList
,
TSalaryAccount
a
)
{
// B7 = 当月实发合计
// 税=ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
...
...
@@ -1655,12 +1646,16 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal
actualSalarySumT
;
// 当月实发合计
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
// 历史个税合计
BigDecimal
sumTax
=
BigDecimal
.
ZERO
;
// 个人承担部分历史个税合计
BigDecimal
sumOtherTax
;
BigDecimal
sumOtherTax
=
BigDecimal
.
ZERO
;
// 历史应发合计
BigDecimal
sumSalaryTax
=
BigDecimal
.
ZERO
;
List
<
TSalaryAccount
>
list
=
tSalaryAccountService
.
list
(
Wrappers
.<
TSalaryAccount
>
query
().
lambda
()
.
eq
(
TSalaryAccount:
:
getEmpIdcard
,
a
.
getEmpIdcard
())
.
eq
(
TSalaryAccount:
:
getSalaryMonth
,
a
.
getSalaryMonth
())
.
eq
(
TSalaryAccount:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
));
// 本次实发
for
(
TSalaryAccountItem
item
:
itemList
)
{
if
(
SalaryConstants
.
ACTUAL_SALARY_SUM_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
...
...
@@ -1668,17 +1663,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
actualSalarySumNow
=
actualSalarySumNow
.
add
(
item
.
getSalaryMoney
());
}
}
// 历史实发、个税
for
(
TSalaryAccountItem
item
:
itemHistoryList
)
{
if
(
SalaryConstants
.
SALARY_TAX_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
sumTax
=
sumTax
.
add
(
item
.
getSalaryMoney
());
}
if
(
SalaryConstants
.
RELAY_SALARY_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
sumSalaryTax
=
sumSalaryTax
.
add
(
item
.
getSalaryMoney
());
}
if
(
SalaryConstants
.
ACTUAL_SALARY_SUM_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
actualSalarySum
=
actualSalarySum
.
add
(
item
.
getSalaryMoney
());
}
for
(
TSalaryAccount
account:
list
)
{
sumOtherTax
=
sumOtherTax
.
add
(
BigDecimalUtils
.
safeAdd
(
account
.
getSalaryTax
(),
account
.
getSalaryTaxUnit
()));
sumSalaryTax
=
sumSalaryTax
.
add
(
account
.
getRelaySalaryUnit
());
actualSalarySum
=
actualSalarySum
.
add
(
account
.
getRelaySalary
());
}
//个人承担部分税费
BigDecimal
nowTaxT
;
...
...
@@ -1689,17 +1677,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 1个人承担部分
if
(
SalaryConstants
.
IS_PERSON_TAX_ARR
[
1
].
equals
(
a
.
getIsPersonTax
()))
{
nowTaxT
=
getNowTax
(
actualSalarySumNow
);
if
(
actualSalarySum
.
compareTo
(
actualSalarySumNow
)
!=
0
)
{
//计算历史税费
sumOtherTax
=
getNowTaxNew
(
sumSalaryTax
);
//计算本月实发合计
if
(
sumSalaryTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
//计算本月应发合计
actualSalarySumT
=
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumSalaryTax
,
actualSalarySumNow
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
//累计税费
nowTaxY
=
getNowTaxNew
(
actualSalarySumT
);
if
(
sumOtherTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumOtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
false
,
nowTaxY
,
sumOtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
nowTaxT
);
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
false
,
nowTaxY
,
nowTaxT
);
}
else
{
nowTaxY
=
nowTaxT
;
}
...
...
@@ -1708,15 +1694,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
a
.
setSalaryTax
(
salaryTax
);
a
.
setSalaryTaxUnit
(
nowTaxT
);
a
.
setActualSalary
(
BigDecimalUtils
.
safeSubtract
(
actualSalarySumNow
,
salaryTax
));
a
.
setActualSalary
(
BigDecimalUtils
.
safeSubtract
(
false
,
actualSalarySumNow
,
salaryTax
));
}
else
if
(
SalaryConstants
.
IS_PERSON_TAX_ARR
[
0
].
equals
(
a
.
getIsPersonTax
()))
{
// 0公司承担全部
nowTaxY
=
getNowTax
(
actualSalarySum
);
a
.
setActualSalary
(
actualSalarySumNow
);
if
(
sum
Salary
Tax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
if
(
sum
Other
Tax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
//历史应发税费
sumOtherTax
=
getNowTax
(
sumSalaryTax
);
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumOtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
false
,
nowTaxY
,
sumOtherTax
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
}
a
.
setSalaryTaxUnit
(
nowTaxY
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxY
).
setScale
(
SalaryConstants
.
PLACES
,
RoundingMode
.
HALF_UP
);
...
...
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