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
04772dba
Commit
04772dba
authored
Aug 22, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
b4c74d81
df73b011
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
287 additions
and
19 deletions
+287
-19
TInsuranceOperate.java
...oud/plus/v1/yifu/insurances/entity/TInsuranceOperate.java
+6
-0
TInsuranceOperateMapper.xml
...biz/src/main/resources/mapper/TInsuranceOperateMapper.xml
+2
-1
TSalaryAccountMapper.java
...loud/plus/v1/yifu/salary/mapper/TSalaryAccountMapper.java
+2
-0
TSalaryAccountService.java
...ud/plus/v1/yifu/salary/service/TSalaryAccountService.java
+1
-1
SalaryUploadServiceImpl.java
.../v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
+246
-12
TSalaryAccountServiceImpl.java
...1/yifu/salary/service/impl/TSalaryAccountServiceImpl.java
+7
-2
SalaryAccountUtil.java
...ifu/cloud/plus/v1/yifu/salary/util/SalaryAccountUtil.java
+14
-3
TSalaryAccountMapper.xml
...ry-biz/src/main/resources/mapper/TSalaryAccountMapper.xml
+9
-0
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceOperate.java
View file @
04772dba
...
@@ -36,6 +36,12 @@ public class TInsuranceOperate implements Serializable {
...
@@ -36,6 +36,12 @@ public class TInsuranceOperate implements Serializable {
@Schema
(
description
=
"操作描述"
)
@Schema
(
description
=
"操作描述"
)
private
String
operateDesc
;
private
String
operateDesc
;
/**
* 备注(审核意见)
*/
@Schema
(
description
=
"备注(审核意见)"
)
private
String
remark
;
/**
/**
* 创建者
* 创建者
*/
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceOperateMapper.xml
View file @
04772dba
...
@@ -8,13 +8,14 @@
...
@@ -8,13 +8,14 @@
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceDetailId"
column=
"INSURANCE_DETAIL_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceDetailId"
column=
"INSURANCE_DETAIL_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"operateDesc"
column=
"OPERATE_DESC"
jdbcType=
"VARCHAR"
/>
<result
property=
"operateDesc"
column=
"OPERATE_DESC"
jdbcType=
"VARCHAR"
/>
<result
property=
"remark"
column=
"REMARK"
jdbcType=
"VARCHAR"
/>
<result
property=
"createBy"
column=
"CREATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"createBy"
column=
"CREATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
ID,INSURANCE_DETAIL_ID,OPERATE_DESC,
ID,INSURANCE_DETAIL_ID,OPERATE_DESC,
REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME
CREATE_BY,CREATE_NAME,CREATE_TIME
</sql>
</sql>
</mapper>
</mapper>
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/mapper/TSalaryAccountMapper.java
View file @
04772dba
...
@@ -56,6 +56,8 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
...
@@ -56,6 +56,8 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
**/
List
<
AccountCheckVo
>
getAccountCheckList
(
@Param
(
"settleId"
)
String
settleId
,
@Param
(
"settleMonth"
)
String
settleMonth
);
List
<
AccountCheckVo
>
getAccountCheckList
(
@Param
(
"settleId"
)
String
settleId
,
@Param
(
"settleMonth"
)
String
settleMonth
);
List
<
AccountCheckVo
>
getAccountCheckListLabor
(
@Param
(
"settleId"
)
String
settleId
,
@Param
(
"settleMonth"
)
String
settleMonth
);
/**
/**
* @param empIdCard
* @param empIdCard
* @param nowYear
* @param nowYear
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryAccountService.java
View file @
04772dba
...
@@ -55,7 +55,7 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
...
@@ -55,7 +55,7 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @Date: 2021/9/17 18:06
* @Date: 2021/9/17 18:06
* @return: java.util.Map<java.lang.String, java.lang.Integer>
* @return: java.util.Map<java.lang.String, java.lang.Integer>
**/
**/
Map
<
String
,
Integer
>
getAccountCheckMap
(
String
settleId
,
String
settleMonth
);
Map
<
String
,
Integer
>
getAccountCheckMap
(
String
settleId
,
String
settleMonth
,
String
salaryType
);
/**
/**
* @param empIdCard
* @param empIdCard
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/SalaryUploadServiceImpl.java
View file @
04772dba
...
@@ -169,7 +169,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -169,7 +169,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
Map
<
String
,
Integer
>
ownEmployeeMap
=
tOwnDeptService
.
getOwnEmpMap
();
Map
<
String
,
Integer
>
ownEmployeeMap
=
tOwnDeptService
.
getOwnEmpMap
();
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map
<
String
,
Integer
>
checkMap
=
tSalaryAccountService
.
getAccountCheckMap
(
dept
.
getId
(),
DateUtil
.
addMonth
(
configSalary
.
getSalaryMonth
()));
Map
<
String
,
Integer
>
checkMap
=
tSalaryAccountService
.
getAccountCheckMap
(
dept
.
getId
(),
DateUtil
.
addMonth
(
configSalary
.
getSalaryMonth
())
,
salaryType
);
List
<
String
>
checkListY
=
new
ArrayList
<>();
List
<
String
>
checkListY
=
new
ArrayList
<>();
// 劳务费和稿酬 薪资类型互斥校验Map格式:本年度#身份证号
// 劳务费和稿酬 薪资类型互斥校验Map格式:本年度#身份证号
...
@@ -193,9 +193,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -193,9 +193,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
salaryType
))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
salaryType
))
{
return
this
.
saveAndSubmit
(
saList
);
return
this
.
saveAndSubmit
(
saList
);
}
}
//劳务费导入
//劳务费
和稿酬
导入
if
(
CommonConstants
.
THREE_STRING
.
equals
(
salaryType
))
{
if
(
CommonConstants
.
THREE_STRING
.
equals
(
salaryType
)
||
CommonConstants
.
FOUR_STRING
.
equals
(
salaryType
)
)
{
return
this
.
saveLaborSubmit
(
saList
,
dept
);
return
this
.
saveLaborSubmit
(
saList
,
dept
,
salaryType
);
}
}
}
else
{
}
else
{
return
R
.
failed
(
"导入数据不可为空"
);
return
R
.
failed
(
"导入数据不可为空"
);
...
@@ -940,7 +940,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -940,7 +940,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List
<
TSalaryAccountItem
>
backList
=
new
ArrayList
<>();
List
<
TSalaryAccountItem
>
backList
=
new
ArrayList
<>();
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
())
{
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
())
{
for
(
TSalaryAccountItem
item
:
itemList
)
{
for
(
TSalaryAccountItem
item
:
itemList
)
{
if
(
"
3
"
.
equals
(
item
.
getFormType
())
&&
settleMonth
.
equals
(
item
.
getSettlementMonth
()))
{
if
(
"
4
"
.
equals
(
item
.
getFormType
())
&&
settleMonth
.
equals
(
item
.
getSettlementMonth
()))
{
backList
.
add
(
item
);
backList
.
add
(
item
);
}
}
}
}
...
@@ -1451,7 +1451,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1451,7 +1451,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2022/8/16
* @Date: 2022/8/16
* @return: com.yifu.cloud.v1.common.core.util.R
* @return: com.yifu.cloud.v1.common.core.util.R
**/
**/
public
R
saveLaborSubmit
(
List
<
TSalaryAccountVo
>
savList
,
TSettleDomainSelectVo
dept
)
{
public
R
saveLaborSubmit
(
List
<
TSalaryAccountVo
>
savList
,
TSettleDomainSelectVo
dept
,
String
salaryType
)
{
if
(
Common
.
isNotNull
(
savList
)
&&
!
savList
.
isEmpty
())
{
if
(
Common
.
isNotNull
(
savList
)
&&
!
savList
.
isEmpty
())
{
TSalaryAccountVo
salaryAccountVo
=
savList
.
get
(
0
);
TSalaryAccountVo
salaryAccountVo
=
savList
.
get
(
0
);
List
<
TSalaryAccountItem
>
saiList
=
null
;
//报账明细List
List
<
TSalaryAccountItem
>
saiList
=
null
;
//报账明细List
...
@@ -1489,7 +1489,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1489,7 +1489,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryLock
lockUpdate
;
TSalaryLock
lockUpdate
;
try
{
try
{
// 薪资核心导入代码
// 薪资核心导入代码
return
this
.
doLaborCoreSalary
(
savList
,
saiList
,
sai
,
dept
,
invoiceTitle
,
salary
,
user
);
if
(
CommonConstants
.
THREE_STRING
.
equals
(
salaryType
))
{
return
this
.
doLaborCoreSalary
(
savList
,
saiList
,
sai
,
dept
,
invoiceTitle
,
salary
,
user
);
}
else
{
return
this
.
doRemuCoreSalary
(
savList
,
saiList
,
sai
,
dept
,
invoiceTitle
,
salary
,
user
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
lockUpdate
=
new
TSalaryLock
();
lockUpdate
=
new
TSalaryLock
();
lockUpdate
.
setId
(
lock
.
getId
());
lockUpdate
.
setId
(
lock
.
getId
());
...
@@ -1667,6 +1671,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1667,6 +1671,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 税=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)
// 税=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)
// 本次实发
// 本次实发
BigDecimal
actualSalarySumNow
=
BigDecimal
.
ZERO
;
BigDecimal
actualSalarySumNow
=
BigDecimal
.
ZERO
;
// 当月累计应发合计
BigDecimal
actualSalarySumT
=
BigDecimal
.
ZERO
;
// 当月实发合计
// 当月实发合计
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
BigDecimal
actualSalarySum
=
BigDecimal
.
ZERO
;
// 历史个税合计
// 历史个税合计
...
@@ -1692,23 +1698,27 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1692,23 +1698,27 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//个人不承担部分税费
//个人不承担部分税费
BigDecimal
nowTaxY
=
BigDecimal
.
ZERO
;
BigDecimal
nowTaxY
=
BigDecimal
.
ZERO
;
BigDecimal
relaySalary
;
BigDecimal
relaySalary
;
BigDecimal
salaryTax
=
BigDecimal
.
ZERO
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
a
.
getIsPersonTax
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
a
.
getIsPersonTax
()))
{
nowTaxT
=
getNowTax
(
actualSalarySumNow
);
nowTaxT
=
getNowTax
(
actualSalarySumNow
);
nowTaxY
=
getNowTax
(
actualSalarySum
);
if
(
actualSalarySum
!=
actualSalarySumNow
)
{
actualSalarySumT
=
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumTax
,
actualSalarySum
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
nowTaxY
=
getNowTaxNew
(
actualSalarySumT
);
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumTax
));
}
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
salaryTax
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
BigDecimalUtils
.
safeAdd
(
nowTaxT
,
sumTax
));
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
{
}
else
{
nowTaxY
=
getNowTax
(
actualSalarySum
);
nowTaxY
=
getNowTax
(
actualSalarySum
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
}
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxY
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxY
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
a
.
setSalaryTaxUnit
(
nowTaxY
);
a
.
setSalaryTaxUnit
(
nowTaxY
);
a
.
setActualSalary
(
actualSalarySumNow
);
a
.
setActualSalary
(
actualSalarySumNow
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxY
=
BigDecimalUtils
.
safeSubtract
(
nowTaxY
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
}
a
.
setRelaySalaryUnit
(
relaySalary
);
a
.
setRelaySalaryUnit
(
relaySalary
);
a
.
setRelaySalary
(
actualSalarySumNow
);
a
.
setRelaySalary
(
actualSalarySumNow
);
...
@@ -1753,4 +1763,228 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
...
@@ -1753,4 +1763,228 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
return
nowTax
;
return
nowTax
;
}
}
public
static
BigDecimal
getNowTaxNew
(
BigDecimal
actualSalarySum
)
{
BigDecimal
nowTax
;
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"800"
))
<=
0
)
{
nowTax
=
BigDecimal
.
ZERO
;
}
else
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"4000"
))
<
0
)
{
// (B7-800)/4
nowTax
=
BigDecimalUtils
.
safeDivide
(
BigDecimalUtils
.
safeSubtract
(
actualSalarySum
,
new
BigDecimal
(
"800"
))
,
new
BigDecimal
(
"5"
));
}
else
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"25000"
))
<=
0
)
{
// 0.16*B7/0.84
nowTax
=
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.16"
));
}
else
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"62500"
))
<=
0
)
{
// (0.24*B7-2000)/0.76
nowTax
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.24"
))
,
new
BigDecimal
(
"2000"
));
}
else
{
nowTax
=
BigDecimalUtils
.
safeSubtract
(
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.32"
))
,
new
BigDecimal
(
"7000"
));
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
return
nowTax
;
}
/**
* @Description: 稿酬导入
* @Author: huyc
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public
R
doRemuCoreSalary
(
List
<
TSalaryAccountVo
>
savList
,
List
<
TSalaryAccountItem
>
saiList
,
TSalaryAccountItem
sai
,
TSettleDomainSelectVo
dept
,
String
invoiceTitle
,
TSalaryStandard
salary
,
YifuUser
user
)
{
List
<
TSalaryAccount
>
aList
=
new
ArrayList
<>();
TSalaryAccount
a
;
//定库:
BigDecimal
money
=
new
BigDecimal
(
CommonConstants
.
ZERO_STRING
);
//初始化金额备用
BigDecimal
relaySalarySum
=
BigDecimal
.
ZERO
;
//工资应发
List
<
TSalaryAccountItem
>
asList
;
//累计扣税
int
size
=
savList
.
size
();
// 自有员工人数
int
ownNum
=
0
;
// 自有员工应发金额
BigDecimal
ownMoney
=
BigDecimal
.
ZERO
;
BigDecimal
relaySalary
;
//工资应发
// 劳务费、稿酬是否含有发薪false:否;true:是
boolean
haveSalaryFlag
=
false
;
// 是否含有特殊金额false:否;true:是
boolean
haveSpecialFlag
=
false
;
// 是否重复金额false:否;true:是
boolean
repeatFlag
=
false
;
List
<
String
>
idCardList
=
new
ArrayList
<>();
for
(
TSalaryAccountVo
vo
:
savList
)
{
if
(
Common
.
isNotNull
(
vo
.
getEmpIdcard
()))
{
idCardList
.
add
(
vo
.
getEmpIdcard
());
}
}
// 工资查询所需的全部list,组装Map来使用
Map
<
String
,
List
<
TSalaryAccountItem
>>
itemMap
=
tSalaryAccountItemService
.
getAllItemVoList
(
idCardList
,
invoiceTitle
);
for
(
int
i
=
CommonConstants
.
ZERO_INT
;
i
<
size
;
i
++)
{
relaySalary
=
BigDecimal
.
ZERO
;
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
)
{
haveSalaryFlag
=
true
;
}
if
(!
haveSpecialFlag
&&
a
.
getHaveSpecialFlag
()
!=
null
&&
a
.
getHaveSpecialFlag
()
==
CommonConstants
.
ONE_INT
)
{
haveSpecialFlag
=
true
;
}
if
(!
repeatFlag
&&
a
.
getIsRepeat
()
!=
null
&&
a
.
getIsRepeat
()
==
CommonConstants
.
ONE_INT
)
{
repeatFlag
=
true
;
}
if
(
savList
.
get
(
i
).
getSaiList
()
!=
null
&&
!
savList
.
get
(
i
).
getSaiList
().
isEmpty
())
{
saiList
=
new
ArrayList
<>();
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
);
}
}
// 自有员工以及自有员工应发金额
if
(
Common
.
isNotNull
(
a
.
getOwnFlag
())
&&
a
.
getOwnFlag
()
==
1
)
{
ownNum
++;
ownMoney
=
ownMoney
.
add
(
relaySalary
);
}
//累计扣税list
asList
=
this
.
getLaborAsList
(
itemMap
.
get
(
a
.
getEmpIdcard
()),
a
.
getSettlementMonth
());
// 实发劳务费,按月累计扣税
this
.
saveNewItems
(
sai
,
saiList
,
SalaryConstants
.
SALARY_TAX
,
SalaryConstants
.
SALARY_TAX_JAVA
,
calculationRemu
(
saiList
,
asList
,
saiList
,
a
),
CommonConstants
.
ZERO_INT
);
a
.
setSaiList
(
saiList
);
aList
.
add
(
a
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
salary
.
setOwnNums
(
ownNum
);
salary
.
setOwnMoney
(
ownMoney
);
for
(
TSalaryAccount
account
:
aList
)
{
relaySalarySum
=
relaySalarySum
.
add
(
account
.
getRelaySalaryUnit
());
}
TSalaryDetailVo
salaryDetailVo
=
new
TSalaryDetailVo
();
salaryDetailVo
.
setSalaryAccountList
(
aList
);
salary
.
setSettlementAmount
(
relaySalarySum
);
salary
.
setHaveSalaryFlag
(
CommonConstants
.
ZERO_INT
);
salary
.
setHaveSpecialFlag
(
CommonConstants
.
ZERO_INT
);
salary
.
setIsRepeat
(
CommonConstants
.
ZERO_INT
);
salary
.
setStatus
(
SalaryConstants
.
AUDIT_STATUS
[
0
]);
if
(
haveSalaryFlag
||
haveSpecialFlag
||
ownNum
>
0
||
repeatFlag
)
{
if
(
haveSalaryFlag
)
{
salary
.
setHaveSalaryFlag
(
CommonConstants
.
ONE_INT
);
}
if
(
haveSpecialFlag
)
{
salary
.
setHaveSpecialFlag
(
CommonConstants
.
ONE_INT
);
}
if
(
repeatFlag
)
{
salary
.
setIsRepeat
(
CommonConstants
.
ONE_INT
);
}
}
//保存工资表
tSalaryStandardService
.
save
(
salary
);
for
(
TSalaryAccount
account
:
aList
)
{
saiList
=
account
.
getSaiList
();
account
.
setSaiList
(
null
);
account
.
setSalaryFormId
(
salary
.
getId
());
tSalaryAccountService
.
save
(
account
);
for
(
TSalaryAccountItem
item
:
saiList
)
{
item
.
setSalaryAccountId
(
account
.
getId
());
tSalaryAccountItemService
.
save
(
item
);
}
}
// 获取上一个工资条顺序,复制:
tSalaryStandardSetService
.
copyLastSetByDeptId
(
salary
.
getId
(),
dept
.
getId
(),
String
.
valueOf
(
user
.
getId
()));
salaryDetailVo
.
setSalary
(
salary
);
return
R
.
ok
(
salaryDetailVo
);
}
/**
* @param itemList
* @param itemHistoryList
* @param saiList
* @Description: 计算劳务费个税、应发
* @Author: hgw
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private
static
BigDecimal
calculationRemu
(
List
<
TSalaryAccountItem
>
itemList
,
List
<
TSalaryAccountItem
>
itemHistoryList
,
List
<
TSalaryAccountItem
>
saiList
,
TSalaryAccount
a
)
{
// 本次实发
BigDecimal
actualSalarySumNow
=
BigDecimal
.
ZERO
;
// 历史个税合计
BigDecimal
sumTax
=
BigDecimal
.
ZERO
;
// 本次实发
for
(
TSalaryAccountItem
item
:
itemList
)
{
if
(
SalaryConstants
.
ACTUAL_SALARY_SUM_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
actualSalarySumNow
=
actualSalarySumNow
.
add
(
item
.
getSalaryMoney
());
}
}
// 历史实发、个税
for
(
TSalaryAccountItem
item
:
itemHistoryList
)
{
if
(
SalaryConstants
.
SALARY_TAX_JAVA
.
equals
(
item
.
getJavaFiedName
()))
{
sumTax
=
sumTax
.
add
(
item
.
getSalaryMoney
());
}
}
//个人税费
BigDecimal
nowTaxT
=
BigDecimal
.
ZERO
;
BigDecimal
relaySalary
;
nowTaxT
=
getNowTaxRemu
(
actualSalarySumNow
);
relaySalary
=
BigDecimalUtils
.
safeAdd
(
actualSalarySumNow
,
nowTaxT
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
a
.
setSalaryTaxUnit
(
nowTaxT
);
a
.
setActualSalary
(
actualSalarySumNow
);
a
.
setRelaySalaryUnit
(
relaySalary
);
a
.
setRelaySalary
(
actualSalarySumNow
);
if
(
sumTax
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
nowTaxT
=
BigDecimalUtils
.
safeSubtract
(
nowTaxT
,
sumTax
).
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
}
// 本次个人应发合计
TSalaryAccountItem
sai
=
new
TSalaryAccountItem
();
sai
.
setCnName
(
SalaryConstants
.
RELAY_SALARY
);
sai
.
setJavaFiedName
(
SalaryConstants
.
RELAY_SALARY_JAVA
);
sai
.
setIsTax
(
CommonConstants
.
ZERO_INT
);
sai
.
setSalaryMoney
(
relaySalary
);
saiList
.
add
(
sai
);
return
nowTaxT
;
}
public
static
BigDecimal
getNowTaxRemu
(
BigDecimal
actualSalarySum
)
{
BigDecimal
nowTax
;
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"800"
))
<=
0
)
{
nowTax
=
BigDecimal
.
ZERO
;
}
else
if
(
actualSalarySum
.
compareTo
(
new
BigDecimal
(
"4000"
))
<=
0
)
{
//(x-800)*0.14
nowTax
=
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeSubtract
(
actualSalarySum
,
new
BigDecimal
(
"800"
))
,
new
BigDecimal
(
"0.14"
));
}
else
{
//x*0.16*0.7
nowTax
=
BigDecimalUtils
.
safeMultiply
(
actualSalarySum
,
new
BigDecimal
(
"0.112"
));
}
nowTax
=
nowTax
.
setScale
(
SalaryConstants
.
PLACES
,
BigDecimal
.
ROUND_HALF_UP
);
return
nowTax
;
}
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryAccountServiceImpl.java
View file @
04772dba
...
@@ -158,8 +158,13 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
...
@@ -158,8 +158,13 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
}
}
@Override
@Override
public
Map
<
String
,
Integer
>
getAccountCheckMap
(
String
settleId
,
String
settleMonth
)
{
public
Map
<
String
,
Integer
>
getAccountCheckMap
(
String
settleId
,
String
settleMonth
,
String
salaryType
)
{
List
<
AccountCheckVo
>
list
=
baseMapper
.
getAccountCheckList
(
settleId
,
settleMonth
);
List
<
AccountCheckVo
>
list
=
new
ArrayList
<>();
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
salaryType
))
{
list
=
baseMapper
.
getAccountCheckList
(
settleId
,
settleMonth
);
}
else
{
list
=
baseMapper
.
getAccountCheckListLabor
(
settleId
,
settleMonth
);
}
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
for
(
AccountCheckVo
str
:
list
)
{
for
(
AccountCheckVo
str
:
list
)
{
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/util/SalaryAccountUtil.java
View file @
04772dba
...
@@ -333,6 +333,17 @@ public class SalaryAccountUtil implements Serializable {
...
@@ -333,6 +333,17 @@ public class SalaryAccountUtil implements Serializable {
entity
.
setHaveSpecialFlag
(
CommonConstants
.
ONE_INT
);
entity
.
setHaveSpecialFlag
(
CommonConstants
.
ONE_INT
);
}
}
}
}
if
(
actualSalarySum
!=
null
)
{
actualSalarySum
=
actualSalarySum
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
if
(!
checkMap
.
isEmpty
()
&&
checkMap
.
get
(
entity
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
DateUtil
.
addMonth
(
configSalary
.
getSalaryMonth
())
+
CommonConstants
.
DOWN_LINE_STRING
+
salaryType
+
CommonConstants
.
DOWN_LINE_STRING
+
actualSalarySum
)
!=
null
)
{
entity
.
setIsRepeat
(
CommonConstants
.
ONE_INT
);
}
if
(
new
BigDecimal
(
"3500"
).
compareTo
(
actualSalarySum
)
==
CommonConstants
.
ZERO_INT
||
new
BigDecimal
(
"5000"
).
compareTo
(
actualSalarySum
)
==
CommonConstants
.
ZERO_INT
)
{
entity
.
setHaveSpecialFlag
(
CommonConstants
.
ONE_INT
);
}
}
if
(
Common
.
isNotNull
(
checkListY
)
&&
checkListY
.
contains
(
entity
.
getEmpIdcard
()))
{
if
(
Common
.
isNotNull
(
checkListY
)
&&
checkListY
.
contains
(
entity
.
getEmpIdcard
()))
{
entity
.
setHaveSalaryFlag
(
CommonConstants
.
ONE_INT
);
entity
.
setHaveSalaryFlag
(
CommonConstants
.
ONE_INT
);
}
}
...
@@ -373,7 +384,7 @@ public class SalaryAccountUtil implements Serializable {
...
@@ -373,7 +384,7 @@ public class SalaryAccountUtil implements Serializable {
}
}
}
}
if
(
entity
!=
null
)
{
if
(
entity
!=
null
)
{
if
(!
"3"
.
equals
(
salaryType
))
{
if
(!
"3"
.
equals
(
salaryType
)
&&
!
"4"
.
equals
(
salaryType
)
)
{
if
(
Common
.
isEmpty
(
entity
.
getTaxMonth
()))
{
if
(
Common
.
isEmpty
(
entity
.
getTaxMonth
()))
{
error
=
"第"
+
(
i
+
2
)
+
"行:新员工-计税月份-不可为空!"
;
error
=
"第"
+
(
i
+
2
)
+
"行:新员工-计税月份-不可为空!"
;
errorList
.
add
(
new
ErrorMessage
((
i
+
2
),
error
));
errorList
.
add
(
new
ErrorMessage
((
i
+
2
),
error
));
...
@@ -467,7 +478,7 @@ public class SalaryAccountUtil implements Serializable {
...
@@ -467,7 +478,7 @@ public class SalaryAccountUtil implements Serializable {
newEmp
.
setUnitNo
(
dept
.
getCustomerCode
());
newEmp
.
setUnitNo
(
dept
.
getCustomerCode
());
newEmp
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
newEmp
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
newEmp
.
setCreateName
(
user
.
getNickname
());
newEmp
.
setCreateName
(
user
.
getNickname
());
if
(!
"3"
.
equals
(
salaryType
))
{
if
(!
"3"
.
equals
(
salaryType
)
&&
!
"4"
.
equals
(
salaryType
)
)
{
minTaxMonth
=
tSalaryAccountService
.
getMinTaxMonthByNowYear
(
newEmp
.
getEmpIdcard
(),
nowYear
);
minTaxMonth
=
tSalaryAccountService
.
getMinTaxMonthByNowYear
(
newEmp
.
getEmpIdcard
(),
nowYear
);
if
(
Common
.
isNotNull
(
minTaxMonth
)
if
(
Common
.
isNotNull
(
minTaxMonth
)
&&
!
minTaxMonth
.
equals
(
entity
.
getTaxMonth
()))
{
&&
!
minTaxMonth
.
equals
(
entity
.
getTaxMonth
()))
{
...
@@ -575,7 +586,7 @@ public class SalaryAccountUtil implements Serializable {
...
@@ -575,7 +586,7 @@ public class SalaryAccountUtil implements Serializable {
entity
.
setBankNo
(
null
);
entity
.
setBankNo
(
null
);
}
}
}
}
if
(!
"3"
.
equals
(
salaryType
))
{
if
(!
"3"
.
equals
(
salaryType
)
&&
!
"4"
.
equals
(
salaryType
)
)
{
if
(
emp
.
getTaxMonth
().
length
()
>
CommonConstants
.
dingleDigitIntArray
[
6
])
{
if
(
emp
.
getTaxMonth
().
length
()
>
CommonConstants
.
dingleDigitIntArray
[
6
])
{
entity
.
setTaxMonth
(
emp
.
getTaxMonth
().
substring
(
0
,
6
));
entity
.
setTaxMonth
(
emp
.
getTaxMonth
().
substring
(
0
,
6
));
}
else
if
(
emp
.
getTaxMonth
().
length
()
<
CommonConstants
.
dingleDigitIntArray
[
6
])
{
}
else
if
(
emp
.
getTaxMonth
().
length
()
<
CommonConstants
.
dingleDigitIntArray
[
6
])
{
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TSalaryAccountMapper.xml
View file @
04772dba
...
@@ -261,6 +261,15 @@
...
@@ -261,6 +261,15 @@
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
</select>
</select>
<!-- 获取校验的报账明细 ### 格式:身份证号_工资月份_报表类型_应发金额 -->
<select
id=
"getAccountCheckListLabor"
resultType=
"com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo"
>
select
CONCAT(a.EMP_IDCARD,"_",a.SALARY_MONTH,"_",a.FORM_TYPE) title,ifnull(actSalary.SALARY_MONEY,0) relaySalary
from t_salary_account a
left join t_salary_account_item actSalary on actSalary.SALARY_ACCOUNT_ID = a.id and actSalary.JAVA_FIED_NAME='actualSalarySum'
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
</select>
<!-- 获取当前年最小计税月 -->
<!-- 获取当前年最小计税月 -->
<select
id=
"getMinTaxMonthByNowYear"
resultType=
"java.lang.String"
>
<select
id=
"getMinTaxMonthByNowYear"
resultType=
"java.lang.String"
>
select
select
...
...
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