钱智考勤引用逻辑跳转

This commit is contained in:
Harryxzy 2025-08-18 17:24:44 +08:00
parent 4fd9883858
commit 6e56660e1a
1 changed files with 38 additions and 4 deletions

View File

@ -464,7 +464,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
employeeIds = employeeIds.stream().filter(empId -> !specialAttendEmpIds.contains(empId)).collect(Collectors.toList());
}
// 4.获取考勤模块数据
List<Map<String, Object>> attendQuoteSyncData = getAttendQuoteDataFromRemoteAttend(salarySobCycleDTO.getAttendCycle(), employeeIds, attendQuoteFields, specialAttendRangeMap);
List<Map<String, Object>> attendQuoteSyncData = getAttendQuoteDataFromRemoteAttend(salarySobCycleDTO.getAttendCycle(), employeeIds, attendQuoteFields, specialAttendRangeMap, specialAttendEmpIds);
List<AttendQuoteDataPO> pos = new ArrayList<>();
List<AttendQuoteDataValuePO> values = new ArrayList<>();
// 5.考勤引用数据处理
@ -627,8 +627,18 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
* @param attendQuoteFields
* @return
*/
private List<Map<String, Object>> getAttendQuoteDataFromRemoteAttend(LocalDateRange attendCycleRange, List<Long> employeeIds, List<AttendQuoteFieldPO> attendQuoteFields, Map<String, LocalDateRange> specialAttendRangeMap) {
private List<Map<String, Object>> getAttendQuoteDataFromRemoteAttend(LocalDateRange attendCycleRange, List<Long> employeeIds, List<AttendQuoteFieldPO> attendQuoteFields, Map<String, LocalDateRange> specialAttendRangeMap, Set<Long> specialAttendEmpIds) {
List<Map<String, Object>> attendQuoteSyncData = new ArrayList<>();
// 获取哪些字段需要获取整月的值
BaseBean baseBean = new BaseBean();
List<String> fullMonthAttendFields = Arrays.stream(baseBean.getPropValue("qzSalaryAttend", "full_month_attend_fields").split(",")).collect(Collectors.toList());
List<AttendQuoteFieldPO> fullMonthAttendFieldList = new ArrayList<>();
List<AttendQuoteFieldPO> specialAttednFieldList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(attendQuoteFields)) {
fullMonthAttendFieldList = attendQuoteFields.stream().filter(f -> fullMonthAttendFields.contains(f.getCode())).collect(Collectors.toList());
specialAttednFieldList = attendQuoteFields.stream().filter(f -> !fullMonthAttendFields.contains(f.getCode())).collect(Collectors.toList());
}
Attend4Salary attend4Salary = new Attend4Salary();
try {
int partSize = 500;
@ -650,11 +660,35 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
}
if (CollectionUtils.isNotEmpty(specialAttendEmpIds)) {
//班次信息
String attendanceSerial = attendQuoteFields.stream()
String attendanceSerial = fullMonthAttendFieldList.stream()
.filter(f -> f.getCode() != null && f.getCode().startsWith("attendanceSerial_"))
.map(f -> f.getCode().replace("attendanceSerial_", ""))
.collect(Collectors.joining(","));
attend4Salary = new Attend4Salary();
for (Map.Entry<String, LocalDateRange> entry : specialAttendRangeMap.entrySet()) {
String[] split = entry.getKey().split("_split");
Long taxAgentId = split.length > 0 && NumberUtils.isCreatable(split[0]) ? Long.valueOf(split[0]) : 0L;
Long employeeId = split.length > 1 && NumberUtils.isCreatable(split[1]) ? Long.valueOf(split[1]) : 0L;
attend4Salary.setBeginDate(attendCycleRange.getFromDate());
attend4Salary.setEndDate(attendCycleRange.getEndDate());
attend4Salary.setOnlyEmpIds(Collections.singletonList(employeeId));
attend4Salary.setAttendanceSerial(attendanceSerial);
List<Map<String, String>> attendResult = getRemoteAttend4SalaryService(user).getDatas(attend4Salary);
AttendQuoteDataBO.buildAttendDataFromRemote(attendResult, fullMonthAttendFieldList, attendQuoteSyncData, taxAgentId);
}
}
//班次信息
String attendanceSerial = specialAttednFieldList.stream()
.filter(f -> f.getCode() != null && f.getCode().startsWith("attendanceSerial_"))
.map(f -> f.getCode().replace("attendanceSerial_", ""))
.collect(Collectors.joining(","));
attend4Salary = new Attend4Salary();
for (Map.Entry<String, LocalDateRange> entry : specialAttendRangeMap.entrySet()) {
String[] split = entry.getKey().split("_split");
Long taxAgentId = split.length > 0 && NumberUtils.isCreatable(split[0]) ? Long.valueOf(split[0]) : 0L;
@ -666,7 +700,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<Map<String, String>> attendResult = getRemoteAttend4SalaryService(user).getDatas(attend4Salary);
AttendQuoteDataBO.buildAttendDataFromRemote(attendResult, attendQuoteFields, attendQuoteSyncData, taxAgentId);
AttendQuoteDataBO.buildAttendDataFromRemote(attendResult, specialAttednFieldList, attendQuoteSyncData, taxAgentId);
}
} catch (Exception e) {
log.error("salaryAttend获取考勤数据错误失败:{}", String.format("参数:%s,错误信息:%s", JSONObject.toJSONString(attend4Salary), e.getMessage()), e);