Commit c127f9f0 authored by huyuchen's avatar huyuchen

hyc-项目余额调整

parent a5ddf7c9
...@@ -335,7 +335,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -335,7 +335,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
deptName = excel.getDeptName(); deptName = excel.getDeptName();
ClaimRebackInfotVO backInfo = new ClaimRebackInfotVO(); ClaimRebackInfotVO backInfo = new ClaimRebackInfotVO();
if (money.compareTo(BigDecimal.ZERO) > 0) { if (money.compareTo(BigDecimal.ZERO) >= 0) {
//先找到彭超创建的款项认领明细 //先找到彭超创建的款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"1"); info = baseMapper.getClaimInfoByDeptNo(deptNo,"1");
//调整金额大于零的先找到彭超创建的款项认领明细直接加 //调整金额大于零的先找到彭超创建的款项认领明细直接加
...@@ -362,7 +362,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -362,7 +362,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
//调整金额小于零的先找到剩余金额大于零的彭超创建的款项认领明细去扣减 //调整金额小于零的先找到剩余金额大于零的彭超创建的款项认领明细去扣减
info = baseMapper.getClaimInfoByDeptNo(deptNo,"3"); info = baseMapper.getClaimInfoByDeptNo(deptNo,"3");
if (Optional.ofNullable(info).isPresent()) { if (Optional.ofNullable(info).isPresent()) {
if (BigDecimalUtils.safeAdd(info.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) { if (info.getSurMoney().add(money).compareTo(BigDecimal.ZERO) >=0) {
info.setAdjustMoney(money); info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money)); info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
...@@ -376,31 +376,21 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -376,31 +376,21 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
} }
} }
/**
* @Description: 推送ekp时更改日期格式
* @Author: huyc
**/
public String dateStringInsert(String month) {
StringBuilder sb = new StringBuilder(month);
sb.insert(4, "-");
return sb.toString();
}
public void subSwitch(String deptNo,ClaimRebackInfotVO backInfo,List<ErrorMessage>errorMessageList, public void subSwitch(String deptNo,ClaimRebackInfotVO backInfo,List<ErrorMessage>errorMessageList,
BigDecimal money,String deptName,ClaimInfotVO excel) { BigDecimal money,String deptName,ClaimInfotVO excel) {
List<ClaimRebackInfotVO> infoList = baseMapper.getClaimBigInfoByDeptNoAndUser(deptNo); List<ClaimRebackInfotVO> infoList = baseMapper.getClaimBigInfoByDeptNoAndUser(deptNo);
if (Optional.ofNullable(infoList).isPresent()) { if (Optional.ofNullable(infoList).isPresent()) {
for (ClaimRebackInfotVO subInfo : infoList) { for (ClaimRebackInfotVO subInfo : infoList) {
//分批去减去金额 //分批去减去金额
if (BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) { if (subInfo.getSurMoney().add(money).compareTo(BigDecimal.ZERO) >=0) {
subInfo.setAdjustMoney(money); subInfo.setAdjustMoney(money);
subInfo.setAfterAdjustMoney(BigDecimalUtils.safeSubtract(subInfo.getSurMoney(),money)); subInfo.setAfterAdjustMoney(BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
break; break;
} else { } else {
subInfo.setAdjustMoney(subInfo.getSurMoney()); subInfo.setAdjustMoney(money);
subInfo.setAfterAdjustMoney(BigDecimal.ZERO); subInfo.setAfterAdjustMoney(BigDecimal.ZERO);
money = BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money); money = subInfo.getSurMoney().add(money);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
} }
} }
......
...@@ -158,8 +158,8 @@ ...@@ -158,8 +158,8 @@
fd_3afb4c634ebd08 claimNo, fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney, fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney, fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney, ifnull(fd_3afb46d05d19ec,0) surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d %H:%i') claimTime
from from
ekp_94b6cd1535e4b34865c8 ekp_94b6cd1535e4b34865c8
where where
...@@ -184,8 +184,8 @@ ...@@ -184,8 +184,8 @@
fd_3afb4c634ebd08 claimNo, fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney, fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney, fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney, ifnull(fd_3afb46d05d19ec,0) surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d %H:%i') claimTime
from from
ekp_94b6cd1535e4b34865c8 ekp_94b6cd1535e4b34865c8
where where
......
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