重新核算或者回算时删除报表缓存

This commit is contained in:
钱涛 2023-06-19 09:54:02 +08:00
parent ec67c89e7d
commit 16cf63018f
2 changed files with 12 additions and 16 deletions

View File

@ -18,6 +18,8 @@ import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
import com.engine.salary.mapper.salarybill.SalarySendMapper;
import com.engine.salary.report.service.SalaryStatisticsReportService;
import com.engine.salary.report.service.impl.SalaryStatisticsReportServiceImpl;
import com.engine.salary.service.*;
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
import com.engine.salary.sys.service.SalarySysConfService;
@ -96,6 +98,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user);
}
private SalaryStatisticsReportService getSalaryStatisticsReportService(User user) {
return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user);
}
@Override
public SalaryAcctRecordPO getById(Long id) {
@ -551,6 +557,9 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
// 生成工资单
getSalarySendService(user).generateSalaryBill(salaryAcctRecordId);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
// 记录日志
// String targetName = getLogTargetNameById(salaryAcctRecordId);
@ -675,6 +684,9 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue());
salaryAcctRecordPO.setUpdateTime(new Date());
getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}

View File

@ -590,8 +590,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
}
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
// 存储薪资核算结果数据来源日志
salaryAcctResultPOS = getSalaryAcctRecordService(user).listBySalaryAcctEmpId(saveParam.getSalaryAcctEmpId());
@ -648,8 +646,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<List<SalaryAcctResultPO>> partition = Lists.partition(list, 100);
partition.forEach(getSalaryAcctResultMapper()::batchInsert);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}
}
@ -657,26 +653,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds) {
getSalaryAcctResultMapper().deleteBySalaryAcctEmpIds(salaryAcctEmployeeIds);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}
@Override
public void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
getSalaryAcctResultMapper().deleteByAcctEmpIdsAndSalaryItemIds(salaryAcctEmployeeIds, salaryItemIds);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}
@Override
public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
getSalaryAcctResultMapper().deleteBySalaryAcctRecordIds(salaryAcctRecordIds);
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}
@Override
@ -997,9 +984,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
for (List<SalaryAcctResultPO> subSalaryAcctResultValues : partition) {
getSalaryAcctResultMapper().batchUpdateOriginResultValue(subSalaryAcctResultValues);
}
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
}
private Set<Long> canLockSalaryItemIds(Long salarySobId) {