Commit 1a8391d0 authored by huyuchen's avatar huyuchen

项目档案批量操作速度优化

parent 36b3972a
......@@ -350,9 +350,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
sumDeductSalary = BigDecimalUtils.safeAdd(isTax,infoVo.getDeductTaxSalary());
}
//最优解计算区间
BigDecimal oneBecimal = new BigDecimal("36000");
BigDecimal twoBecimal = new BigDecimal("144000");
BigDecimal subOneBecimal = BigDecimalUtils.safeSubtract(wSalary,oneBecimal);
BigDecimal subTwoBecimal1 = BigDecimalUtils.safeSubtract(wSalary,twoBecimal);
if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
compareTo(oneBecimal) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -361,15 +367,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
minSalary = subOneBecimal;
} else {
minSalary = socialFundTax;
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
maxAnualSalary = oneBecimal;
}
} else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("72000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -378,15 +384,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
minSalary = subOneBecimal;
} else {
minSalary = socialFundTax;
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
maxAnualSalary = oneBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("203100")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -395,15 +401,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
minSalary = subOneBecimal;
} else {
minSalary = socialFundTax;
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
maxAnualSalary = oneBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("288000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -412,15 +418,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
minSalary = subTwoBecimal1;
} else {
minSalary = socialFundTax;
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = new BigDecimal("144000");
maxAnualSalary = twoBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("672000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -429,15 +435,17 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
minSalary = subTwoBecimal1;
} else {
minSalary = socialFundTax;
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = new BigDecimal("144000");
maxAnualSalary = twoBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1277500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("300000")) <= 0) {
BigDecimal threeBecimal = new BigDecimal("300000");
BigDecimal subThreeBecimal = BigDecimalUtils.safeSubtract(wSalary,threeBecimal);
if (wSalary.compareTo(threeBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -446,15 +454,17 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000"));
minSalary = subThreeBecimal;
} else {
minSalary = socialFundTax;
minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("300000");
maxAnualSalary = threeBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("420000")) <= 0) {
BigDecimal fourBecimal = new BigDecimal("420000");
BigDecimal subFourBecimal = BigDecimalUtils.safeSubtract(wSalary,fourBecimal);
if (wSalary.compareTo(fourBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -463,15 +473,17 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000"));
minSalary = subFourBecimal;
} else {
minSalary = socialFundTax;
minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("420000");
maxAnualSalary = fourBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) > 0) {
if (wSalary.compareTo(new BigDecimal("660000")) <= 0) {
BigDecimal fiveBecimal = new BigDecimal("660000");
BigDecimal subFiveBecimal = BigDecimalUtils.safeSubtract(wSalary,fiveBecimal);
if (wSalary.compareTo(fiveBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -480,11 +492,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
}else {
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000"));
minSalary = subFiveBecimal;
} else {
minSalary = socialFundTax;
minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax;
}
maxAnualSalary = new BigDecimal("660000");
maxAnualSalary = fiveBecimal;
}
}
......
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