feat: 往期累计一键清空校验bug修复
This commit is contained in:
parent
8e0bf2b693
commit
eb3c75197b
|
|
@ -109,6 +109,8 @@ public interface AddUpDeductionService {
|
|||
*/
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth);
|
||||
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth);
|
||||
|
||||
/**
|
||||
* @description 编辑累计专项附加扣除
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<Long> deleteIds = deleteParam.getIds();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
for (int i = 0; i < deleteIds.size(); i++) {
|
||||
|
|
@ -604,7 +604,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
// 获取所有想要删除的数据
|
||||
List<AddUpDeductionDTO> list = addUpDeductionBiz.list(queryParam);
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
for (AddUpDeductionDTO item : list) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
|
|
@ -1176,4 +1176,25 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth) {
|
||||
List<SalaryAcctEmployeePO> list = Lists.newArrayList();
|
||||
YearMonth month = YearMonth.parse(yearMonth);
|
||||
LocalDate salaryMonthDate = month.atDay(1);
|
||||
LocalDate salaryMonthEndDate = month.atEndOfMonth();
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listByTaxCycle(
|
||||
LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryMonthDate))
|
||||
.endDate(SalaryDateUtil.localDateToDate(salaryMonthEndDate)).build(),
|
||||
null);
|
||||
salaryAcctRecords.forEach(e -> {
|
||||
boolean isAccounted = e.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue();
|
||||
if (isAccounted) {
|
||||
// list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecords.get(0).getId())));
|
||||
list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId())));
|
||||
}
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue