Commit 8f66e2ee authored by 赵啸非's avatar 赵啸非

添加离职人员同步删除考勤组相关人员

parent 821e0ee9
package com.mortals.xhx.module.staff.service.impl; package com.mortals.xhx.module.staff.service.impl;
import com.mortals.xhx.module.attendance.model.AttendanceGroupStaffEntity;
import com.mortals.xhx.module.attendance.model.AttendanceGroupStaffQuery;
import com.mortals.xhx.module.attendance.service.AttendanceGroupStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -6,6 +10,10 @@ import com.mortals.framework.model.Context; ...@@ -6,6 +10,10 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.staff.dao.StaffLeaveDao; import com.mortals.xhx.module.staff.dao.StaffLeaveDao;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity; import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.service.StaffLeaveService; import com.mortals.xhx.module.staff.service.StaffLeaveService;
import org.springframework.util.ObjectUtils;
import java.util.List;
/** /**
* StaffLeaveService * StaffLeaveService
* 员工离职信息 service实现 * 员工离职信息 service实现
...@@ -15,5 +23,26 @@ import com.mortals.xhx.module.staff.service.StaffLeaveService; ...@@ -15,5 +23,26 @@ import com.mortals.xhx.module.staff.service.StaffLeaveService;
*/ */
@Service("staffLeaveService") @Service("staffLeaveService")
public class StaffLeaveServiceImpl extends AbstractCRUDServiceImpl<StaffLeaveDao, StaffLeaveEntity, Long> implements StaffLeaveService { public class StaffLeaveServiceImpl extends AbstractCRUDServiceImpl<StaffLeaveDao, StaffLeaveEntity, Long> implements StaffLeaveService {
@Autowired
private AttendanceGroupStaffService groupStaffService;
@Override
protected void saveAfter(StaffLeaveEntity entity, Context context) throws AppException {
super.saveAfter(entity, context);
AttendanceGroupStaffQuery attendanceGroupStaffQuery = new AttendanceGroupStaffQuery();
attendanceGroupStaffQuery.setStaffId(entity.getStaffId());
List<AttendanceGroupStaffEntity> attendanceGroupStaffEntities = groupStaffService.find(attendanceGroupStaffQuery, context);
if(!ObjectUtils.isEmpty(attendanceGroupStaffEntities)){
Long[] delIds = attendanceGroupStaffEntities.stream().map(attendanceGroupStaffEntity -> attendanceGroupStaffEntity.getId()).toArray(Long[]::new);
if(!ObjectUtils.isEmpty(delIds)){
groupStaffService.remove(delIds, context);
}
}
//删除对应考勤组人员
}
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ Authorization: {{authToken}} ...@@ -38,7 +38,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"attendanceDateStart":"2023-12-01", "attendanceDateStart":"2024-01-01",
"attendanceDateEnd":"2024-01-24" "attendanceDateEnd":"2024-01-24"
} }
...@@ -55,14 +55,14 @@ Content-Type: application/json ...@@ -55,14 +55,14 @@ Content-Type: application/json
###海康考勤打卡记录计算 ###海康考勤打卡记录虚增记录
POST {{baseUrl}}/attendance/record/hik/addAttendanceRecordCustom POST {{baseUrl}}/attendance/record/hik/addAttendanceRecordCustom
Authorization: {{authToken}} Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"attendanceDateStart":"2023-12-01", "attendanceDateStart":"2024-01-01",
"attendanceDateEnd":"2024-01-25" "attendanceDateEnd":"2024-01-24"
} }
...@@ -72,7 +72,7 @@ Authorization: {{authToken}} ...@@ -72,7 +72,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"attendanceDateStart":"2024-01-01", "attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2024-01-25" "attendanceDateEnd":"2024-01-25"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment