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