Commit 4f7aa894 authored by huyuchen's avatar huyuchen

年终奖问题修改

parent f811be51
...@@ -354,16 +354,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -354,16 +354,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal oneBecimal = new BigDecimal("36000"); BigDecimal oneBecimal = new BigDecimal("36000");
BigDecimal twoBecimal = new BigDecimal("144000"); BigDecimal twoBecimal = new BigDecimal("144000");
BigDecimal subOneBecimal = BigDecimalUtils.safeSubtract(wSalary,oneBecimal); BigDecimal subOneBecimal = BigDecimalUtils.safeSubtract(wSalary,oneBecimal);
BigDecimal subTwoBecimal1 = BigDecimalUtils.safeSubtract(wSalary,twoBecimal); BigDecimal subTwoBecimal = BigDecimalUtils.safeSubtract(wSalary,twoBecimal);
if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(oneBecimal) <= 0) { compareTo(oneBecimal) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -371,16 +368,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -371,16 +368,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax; minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
} }
maxAnualSalary = oneBecimal;
} }
} else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). } else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("72000")) <= 0) { compareTo(new BigDecimal("72000")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -388,16 +381,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -388,16 +381,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax; minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
} }
maxAnualSalary = oneBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("203100")) <= 0) { compareTo(new BigDecimal("203100")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) { if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -405,52 +394,40 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -405,52 +394,40 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax; minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
} }
maxAnualSalary = oneBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("288000")) <= 0) { compareTo(new BigDecimal("288000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) { if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
minSalary = subTwoBecimal1; minSalary = subTwoBecimal;
} else { } else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax; minSalary = subTwoBecimal.compareTo(socialFundTax) >0 ? subTwoBecimal : socialFundTax;
} }
maxAnualSalary = twoBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("672000")) <= 0) { compareTo(new BigDecimal("672000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) { if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
minSalary = subTwoBecimal1; minSalary = subTwoBecimal;
} else { } else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax; minSalary = subTwoBecimal.compareTo(socialFundTax) >0 ? subTwoBecimal : socialFundTax;
} }
maxAnualSalary = twoBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1277500")) <= 0) { compareTo(new BigDecimal("1277500")) <= 0) {
BigDecimal threeBecimal = new BigDecimal("300000"); BigDecimal threeBecimal = new BigDecimal("300000");
BigDecimal subThreeBecimal = BigDecimalUtils.safeSubtract(wSalary,threeBecimal); BigDecimal subThreeBecimal = BigDecimalUtils.safeSubtract(wSalary,threeBecimal);
if (wSalary.compareTo(threeBecimal) <= 0) { if (wSalary.compareTo(threeBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -458,18 +435,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -458,18 +435,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax; minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax;
} }
maxAnualSalary = threeBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) <= 0) { compareTo(new BigDecimal("1452500")) <= 0) {
BigDecimal fourBecimal = new BigDecimal("420000"); BigDecimal fourBecimal = new BigDecimal("420000");
BigDecimal subFourBecimal = BigDecimalUtils.safeSubtract(wSalary,fourBecimal); BigDecimal subFourBecimal = BigDecimalUtils.safeSubtract(wSalary,fourBecimal);
if (wSalary.compareTo(fourBecimal) <= 0) { if (wSalary.compareTo(fourBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -477,18 +450,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -477,18 +450,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax; minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax;
} }
maxAnualSalary = fourBecimal;
} }
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary). }else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) > 0) { compareTo(new BigDecimal("1452500")) > 0) {
BigDecimal fiveBecimal = new BigDecimal("660000"); BigDecimal fiveBecimal = new BigDecimal("660000");
BigDecimal subFiveBecimal = BigDecimalUtils.safeSubtract(wSalary,fiveBecimal); BigDecimal subFiveBecimal = BigDecimalUtils.safeSubtract(wSalary,fiveBecimal);
if (wSalary.compareTo(fiveBecimal) <= 0) { if (wSalary.compareTo(fiveBecimal) <= 0) {
if (isSend) { if (!isSend) {
maxAnualSalary = wSalary;
} else {
minSalary = socialFundTax; minSalary = socialFundTax;
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
} }
}else { }else {
if (isSend) { if (isSend) {
...@@ -496,12 +465,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -496,12 +465,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else { } else {
minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax; minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax;
} }
maxAnualSalary = fiveBecimal;
} }
} }
JSONObject jsonObject = calculationPersonSalary(personTax, annousTax, minSalary, maxAnualSalary, JSONObject jsonObject = calculationPersonSalary(personTax, annousTax, minSalary, wSalary, sumTax,
wSalary, sumTax, ySalary, sumDeductSalary, twlSalaryTax); ySalary, sumDeductSalary, twlSalaryTax);
res = jsonObject.getBigDecimal("zySalary"); res = jsonObject.getBigDecimal("zySalary");
BigDecimal anRes = BigDecimal.ZERO; BigDecimal anRes = BigDecimal.ZERO;
if (Common.isNotNull(jsonObject.getBigDecimal("anRes"))) { if (Common.isNotNull(jsonObject.getBigDecimal("anRes"))) {
...@@ -535,7 +503,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -535,7 +503,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
* @param personTax 薪资扣税阶梯表list * @param personTax 薪资扣税阶梯表list
* @param annousTax 年终奖扣税阶梯表list * @param annousTax 年终奖扣税阶梯表list
* @param minSalary 工资下限 * @param minSalary 工资下限
* @param maxAnualSalary 年终奖上限
* @param wSalary 未发金额 * @param wSalary 未发金额
* @param ySalary 应发工资合计 * @param ySalary 应发工资合计
* @param sumTax 薪资扣税合计 * @param sumTax 薪资扣税合计
...@@ -546,15 +513,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap ...@@ -546,15 +513,14 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
* @return: java.math.BigDecimal * @return: java.math.BigDecimal
**/ **/
private static JSONObject calculationPersonSalary(List<TSalaryTaxConfig> personTax, List<TSalaryTaxConfig> annousTax, private static JSONObject calculationPersonSalary(List<TSalaryTaxConfig> personTax, List<TSalaryTaxConfig> annousTax,
BigDecimal minSalary, BigDecimal maxAnualSalary, BigDecimal minSalary,BigDecimal wSalary, BigDecimal sumTax, BigDecimal ySalary,
BigDecimal wSalary, BigDecimal sumTax, BigDecimal ySalary,
BigDecimal sumDeductSalary, BigDecimal twlSalaryTax) { BigDecimal sumDeductSalary, BigDecimal twlSalaryTax) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
BigDecimal anRes; BigDecimal anRes;
BigDecimal res; BigDecimal res;
List<BigDecimal> zySalary = new ArrayList<>(); List<BigDecimal> zySalary = new ArrayList<>();
Map<String,BigDecimal> map = new HashMap<>(); Map<String,BigDecimal> map = new HashMap<>();
for (BigDecimal i = minSalary; i.compareTo(maxAnualSalary) <= 0; i = BigDecimalUtils.safeAdd(i,new BigDecimal(100)) ) { for (BigDecimal i = minSalary; i.compareTo(wSalary) <= 0; i = BigDecimalUtils.safeAdd(i,new BigDecimal(100)) ) {
//本次薪资纳税额 //本次薪资纳税额
res = BigDecimal.ZERO; res = BigDecimal.ZERO;
//本次年终奖纳税额 //本次年终奖纳税额
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment