Merge branch 'release/2.15.1.2407.01' into custom/京贵投资

This commit is contained in:
Harryxzy 2024-08-15 17:11:02 +08:00
commit e20b6cb2f6
5 changed files with 8 additions and 50 deletions

View File

@ -135,6 +135,7 @@ public class SalaryBillBO {
.employeeId(simpleEmployee.getEmployeeId())
.taxAgentName(salaryBillSendParam.getTaxAgentName())
.departmentName(simpleEmployee.getDepartmentName())
.companystartdate(simpleEmployee.getCompanystartdate())
.email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
.sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex())
.mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile()).jobtitleName(simpleEmployee.getJobtitleName())

View File

@ -74,53 +74,6 @@ public class SalaryAcctEmployeeBO {
}).collect(Collectors.toList());
}
/**
* 转换成薪资核算人员的po
*
* @param employeeIds
* @param salaryAcctRecord
* @param salaryArchiveTaxAgentData
* @param employeeId
* @return
*/
public static List<SalaryAcctEmployeePO> convert2EmployeePO(Collection<Long> employeeIds,
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
Long employeeId) {
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyList();
}
List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
Map<Long, Set<List<SalaryArchiveTaxAgentDataDTO>>> empIdKeyTaxAgentMap = SalaryEntityUtil.group2Map(salaryArchiveTaxAgentData, SalaryArchiveDataDTO::getEmployeeId, SalaryArchiveDataDTO::getTaxAgents);
Date now = new Date();
for (Long id : employeeIds) {
Set<Long> taxAgentIds = Sets.newHashSet();
Set<List<SalaryArchiveTaxAgentDataDTO>> taxAgentSet = empIdKeyTaxAgentMap.getOrDefault(id, Collections.emptySet());
for (List<SalaryArchiveTaxAgentDataDTO> taxAgents : taxAgentSet) {
taxAgentIds.addAll(SalaryEntityUtil.properties(taxAgents, SalaryArchiveTaxAgentDataDTO::getTaxAgentId));
}
if (CollectionUtils.isEmpty(taxAgentIds)) {
taxAgentIds.add(0L);
}
for (Long taxAgentId : taxAgentIds) {
SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder()
.salaryAcctRecordId(salaryAcctRecord.getId())
.salarySobId(salaryAcctRecord.getSalarySobId())
.salaryMonth(salaryAcctRecord.getSalaryMonth())
.employeeId(id)
.taxAgentId(taxAgentId)
.creator(employeeId)
.createTime(now)
.updateTime(now)
.deleteType(0)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.build();
resultList.add(salaryAcctEmployee);
}
}
return resultList;
}
public static List<SalaryAcctEmployeePO> convert2Employee(Collection<DataCollectionEmployee> employee,
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,

View File

@ -403,10 +403,12 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
}
Long taxAgentId = salarySobPO.getTaxAgentId();
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll((List) saveParam.getEmployeeIds());
// 查询薪资档案
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), saveParam.getEmployeeIds(), taxAgentId);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(saveParam.getEmployeeIds(), salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
//过滤不是扣缴义务人下的人员
@ -565,8 +567,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
// 查询薪资档案获取人员的个税扣缴义务人
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId);
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> newSalaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(employeeIds, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> newSalaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
newSalaryAcctEmployeePOS = newSalaryAcctEmployeePOS.stream().filter(po -> Objects.equals(taxAgentId, po.getTaxAgentId())).collect(Collectors.toList());
// 删除以前的薪资核算人员
getSalaryAcctEmployeeMapper().deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));

View File

@ -377,7 +377,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
}
}
});
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIds(empIds);
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
result.addAll(employees);
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据需要根据人员id去重

View File

@ -471,6 +471,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
.salarySobId(salarySobID)
.targetType(item.getTargetType().getValue())
.targetId(item.getTargetId())
.target(item.getTarget())
.employeeStatuses(item.getEmployeeStatus())
.includeType(0)
.creator(Long.valueOf(user.getUID()))