|
@@ -139,6 +139,7 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
|
|
|
int findPageSize = 20;
|
|
int findPageSize = 20;
|
|
|
|
|
|
|
|
PersonalLeaveListSchoolPeriodRecordsResult result = getXwAttendance(TimeExchange.getDate(),TimeExchange.getDate(), 1, findPageSize);
|
|
PersonalLeaveListSchoolPeriodRecordsResult result = getXwAttendance(TimeExchange.getDate(),TimeExchange.getDate(), 1, findPageSize);
|
|
|
|
|
+// PersonalLeaveListSchoolPeriodRecordsResult result = getXwAttendance("2024-05-23","2024-06-14", 1, findPageSize);
|
|
|
if (result == null) {
|
|
if (result == null) {
|
|
|
return CommonResult.fail("当天不存在请假数据!");
|
|
return CommonResult.fail("当天不存在请假数据!");
|
|
|
}
|
|
}
|
|
@@ -187,26 +188,27 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
|
|
|
Integer totalPage = totalCount / pageSize + 1;
|
|
Integer totalPage = totalCount / pageSize + 1;
|
|
|
for (int i = 2; i <= totalPage; i++) {
|
|
for (int i = 2; i <= totalPage; i++) {
|
|
|
PersonalLeaveListSchoolPeriodRecordsResult nextResult = getXwAttendance(TimeExchange.getDate(), TimeExchange.getDate(), i, findPageSize);
|
|
PersonalLeaveListSchoolPeriodRecordsResult nextResult = getXwAttendance(TimeExchange.getDate(), TimeExchange.getDate(), i, findPageSize);
|
|
|
|
|
+// PersonalLeaveListSchoolPeriodRecordsResult nextResult = getXwAttendance("2024-05-23","2024-06-14", i, findPageSize);
|
|
|
if (nextResult == null) {
|
|
if (nextResult == null) {
|
|
|
return CommonResult.fail("当天不存在请假数据!");
|
|
return CommonResult.fail("当天不存在请假数据!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!nextResult.getResponseBody().getCode().equals("000000")) {
|
|
if (!nextResult.getResponseBody().getCode().equals("000000")) {
|
|
|
- return CommonResult.fail(result.getResponseBody().getMessage());
|
|
|
|
|
|
|
+ return CommonResult.fail(nextResult.getResponseBody().getMessage());
|
|
|
}
|
|
}
|
|
|
- for (int j = 0; j < result.getResponseBody().getData().getResult().size(); j++) {
|
|
|
|
|
- if (result.getResponseBody().getData().getResult().get(j).getLeaveStatus().intValue() == eXwApproveStatu.Passed.getValue()) {
|
|
|
|
|
|
|
+ for (int j = 0; j < nextResult.getResponseBody().getData().getResult().size(); j++) {
|
|
|
|
|
+ if (nextResult.getResponseBody().getData().getResult().get(j).getLeaveStatus().intValue() == eXwApproveStatu.Passed.getValue()) {
|
|
|
SmartAttendance attendance = new SmartAttendance();
|
|
SmartAttendance attendance = new SmartAttendance();
|
|
|
- attendance.setXwuid(result.getResponseBody().getData().getResult().get(j).getUid());
|
|
|
|
|
- attendance.setUserUid(result.getResponseBody().getData().getResult().get(j).getUserUid());
|
|
|
|
|
- attendance.setXwUserName(result.getResponseBody().getData().getResult().get(j).getUserName());
|
|
|
|
|
- attendance.setReason(result.getResponseBody().getData().getResult().get(j).getReason());
|
|
|
|
|
- attendance.setStartTime(TimeExchange.StringToDate(result.getResponseBody().getData().getResult().get(j).getStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
- attendance.setEndTime(TimeExchange.StringToDate(result.getResponseBody().getData().getResult().get(j).getEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
- attendance.setInitiateTime(TimeExchange.StringToDate(result.getResponseBody().getData().getResult().get(j).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
- attendance.setInitiateXwuid(result.getResponseBody().getData().getResult().get(j).getApplyUserUid());
|
|
|
|
|
- attendance.setInitiateXwname(result.getResponseBody().getData().getResult().get(j).getApplyUserName());
|
|
|
|
|
- attendance.setInitiateXwphone(result.getResponseBody().getData().getResult().get(j).getApplyUserPhone());
|
|
|
|
|
|
|
+ attendance.setXwuid(nextResult.getResponseBody().getData().getResult().get(j).getUid());
|
|
|
|
|
+ attendance.setUserUid(nextResult.getResponseBody().getData().getResult().get(j).getUserUid());
|
|
|
|
|
+ attendance.setXwUserName(nextResult.getResponseBody().getData().getResult().get(j).getUserName());
|
|
|
|
|
+ attendance.setReason(nextResult.getResponseBody().getData().getResult().get(j).getReason());
|
|
|
|
|
+ attendance.setStartTime(TimeExchange.StringToDate(nextResult.getResponseBody().getData().getResult().get(j).getStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
+ attendance.setEndTime(TimeExchange.StringToDate(nextResult.getResponseBody().getData().getResult().get(j).getEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
+ attendance.setInitiateTime(TimeExchange.StringToDate(nextResult.getResponseBody().getData().getResult().get(j).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
+ attendance.setInitiateXwuid(nextResult.getResponseBody().getData().getResult().get(j).getApplyUserUid());
|
|
|
|
|
+ attendance.setInitiateXwname(nextResult.getResponseBody().getData().getResult().get(j).getApplyUserName());
|
|
|
|
|
+ attendance.setInitiateXwphone(nextResult.getResponseBody().getData().getResult().get(j).getApplyUserPhone());
|
|
|
attendance.setStatus(eAttendanceStatu.AskLeave.getValue());
|
|
attendance.setStatus(eAttendanceStatu.AskLeave.getValue());
|
|
|
// 加未核销字段
|
|
// 加未核销字段
|
|
|
attendance.setIfVerification(IfVerification);
|
|
attendance.setIfVerification(IfVerification);
|
|
@@ -215,15 +217,15 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //获取当天的请假数据中是否存在重复的
|
|
|
|
|
- List<SmartAttendance> oldAttendances = smartAttendanceService.queryExistAttendances(TimeExchange.getStartDate(), TimeExchange.getEndDate());
|
|
|
|
|
- if (oldAttendances != null && oldAttendances.size() > 0) {
|
|
|
|
|
- if (attendances != null && attendances.size() > 0) {
|
|
|
|
|
- for (SmartAttendance oldAttendance : oldAttendances) {
|
|
|
|
|
- attendances = attendances.stream().filter(e -> !e.getXwuid().equals(oldAttendance.getXwuid())).collect(Collectors.toList());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// //获取当天的请假数据中是否存在重复的
|
|
|
|
|
+// List<SmartAttendance> oldAttendances = smartAttendanceService.queryExistAttendances(TimeExchange.getStartDate(), TimeExchange.getEndDate());
|
|
|
|
|
+// if (oldAttendances != null && oldAttendances.size() > 0) {
|
|
|
|
|
+// if (attendances != null && attendances.size() > 0) {
|
|
|
|
|
+// for (SmartAttendance oldAttendance : oldAttendances) {
|
|
|
|
|
+// attendances = attendances.stream().filter(e -> !e.getXwuid().equals(oldAttendance.getXwuid())).collect(Collectors.toList());
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
//新增请假数据
|
|
//新增请假数据
|
|
|
if (attendances != null && attendances.size() > 0) {
|
|
if (attendances != null && attendances.size() > 0) {
|