Merge branch 'fix/累计专项附加扣除防抖动' into release/2.9.1.2307.01

This commit is contained in:
Harryxzy 2023-07-10 10:10:58 +08:00
commit b7c58ecc11
1 changed files with 8 additions and 7 deletions

View File

@ -637,11 +637,11 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
@Override
public String autoAddAll(Date yearMonth, Boolean isAdmin) {
String cacheKey = "addUpDeduction_autoAddAll_processing";
Object objVal = Util_DataCache.getObjVal( cacheKey);
if(objVal != null){
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试"));
}
try {
Object objVal = Util_DataCache.getObjVal( cacheKey);
if(objVal != null){
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试"));
}
Util_DataCache.setObjVal(cacheKey,true );
//如果是定时任务直接查询所有isAdmin传true
boolean isChief = Boolean.TRUE.equals(isAdmin)
@ -717,14 +717,15 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
AddUpDeduction oldInfo = Optional.ofNullable(currentEmpInfo.get(employeeId))
.flatMap(c -> c.stream().findFirst())
.orElse(null);
Date now = new Date();
if (oldInfo == null) {
addUpDeduction.setCreateTime(yearMonth);
addUpDeduction.setUpdateTime(yearMonth);
addUpDeduction.setCreateTime(now);
addUpDeduction.setUpdateTime(now);
insertList.add(encryptUtil.encrypt(addUpDeduction, AddUpDeduction.class));
} else {
addUpDeduction.setId(oldInfo.getId());
addUpDeduction.setCreateTime(oldInfo.getCreateTime());
addUpDeduction.setUpdateTime(yearMonth);
addUpDeduction.setUpdateTime(now);
updateList.add(encryptUtil.encrypt(addUpDeduction, AddUpDeduction.class));
}
});