diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index ebb461705..b8a8ecd91 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -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)); } });