Commit 8342e5cc authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
parents c344d48e 3e967797
......@@ -773,6 +773,10 @@
) AS 'empNo'
FROM
DUAL
select MAX(EMP_NO) from t_employee_project where
id not like '%abc' and
DEPT_NO = #{deptNo}
GROUP BY DEPT_NO
</select>
<update id="updateEmpIdById" parameterType="java.util.List">
......
......@@ -166,7 +166,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
@Override
public void importDiy(HttpServletResponse response, List<TStatisticsBonusImportVo> list, String deptId){
String fileName = "全年一次性奖金测算导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
ServletOutputStream out = null;
//本次纳税额
BigDecimal res;
//应发工资合计
......@@ -194,8 +193,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal twlSalaryTax;
//12月社保公积金扣费
BigDecimal socialFundTax;
try {
out = response.getOutputStream();
try(ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
......@@ -352,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 {
......@@ -362,12 +366,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
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 {
......@@ -375,12 +383,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
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 {
......@@ -388,12 +400,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
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 {
......@@ -401,12 +417,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
maxAnualSalary = new BigDecimal("144000");
if (isSend) {
minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
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 {
......@@ -414,12 +434,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
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 {
......@@ -427,12 +453,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000"));
maxAnualSalary = new BigDecimal("300000");
if (isSend) {
minSalary = subThreeBecimal;
} else {
minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax;
}
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 {
......@@ -440,12 +472,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000"));
maxAnualSalary = new BigDecimal("420000");
if (isSend) {
minSalary = subFourBecimal;
} else {
minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax;
}
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 {
......@@ -453,8 +491,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000"));
maxAnualSalary = new BigDecimal("660000");
if (isSend) {
minSalary = subFiveBecimal;
} else {
minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax;
}
maxAnualSalary = fiveBecimal;
}
}
......@@ -484,16 +526,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
out.flush();
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}catch (Exception e) {
log.error("执行异常", e);
}
}
......
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