Commit 36b3972a authored by huyuchen's avatar huyuchen

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

parent c95f3128
......@@ -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"));
......@@ -362,7 +360,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
}
} else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -375,7 +377,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -388,7 +394,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("36000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -401,7 +411,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("144000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -414,8 +428,12 @@ 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 = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("144000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1277500")) <= 0) {
......@@ -427,7 +445,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("300000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -440,7 +462,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("420000");
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -453,7 +479,11 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000"));
if (isSend) {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000"));
} else {
minSalary = socialFundTax;
}
maxAnualSalary = new BigDecimal("660000");
}
}
......@@ -484,16 +514,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