Commit 5cff1e01 authored by 赵啸非's avatar 赵啸非

修改用户等

parent a06bdfd0
......@@ -63,7 +63,9 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
log.info("同步部门");
syncDepts();
log.info("同步用户");
syncPersons();
staffService.syncPersons(null);
// syncPersons();
} catch (Exception e) {
log.error("同步人事异常", e);
}
......
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.dept.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.EnableEnum;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.StaffSatusEnum;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
......@@ -139,7 +140,10 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity
for (Iterator<DeptEntity> iterator = list.iterator(); iterator.hasNext(); ) {
DeptEntity deptEntity = iterator.next();
List<StaffEntity> staffEntities = staffService.find(new StaffQuery().deptId(deptEntity.getId()));
StaffQuery staffQuery = new StaffQuery();
staffQuery.setDeptId(deptEntity.getId());
staffQuery.setStatusNotList(Arrays.asList(StaffSatusEnum.离职.getValue()));
List<StaffEntity> staffEntities = staffService.find(staffQuery);
List<Map<String, Object>> personList = new ArrayList<>();
staffEntities.forEach(item -> {
Map<String, Object> map = new HashMap<>();
......@@ -176,8 +180,9 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity
}).map(
m -> {
m.setChildren(getChildren(m, all));
StaffEntity query = new StaffQuery();
StaffQuery query = new StaffQuery();
query.setDeptIdList(getChildrenId(m, all));
query.setStatusNotList(Arrays.asList(StaffSatusEnum.离职.getValue()));
int count = staffService.count(query,null);
m.setPersonNum(count);
return m;
......
......@@ -16,10 +16,8 @@ import com.mortals.xhx.base.system.role.service.RoleUserService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.module.attendance.model.AttendanceStatEntity;
import com.mortals.xhx.module.attendance.model.AttendanceStatQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceEntity;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery;
import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.AttendanceGroupStaffService;
import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.attendance.service.AttendanceVacationBalanceService;
import com.mortals.xhx.module.dept.model.DeptEntity;
......@@ -81,6 +79,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
private IdgeneratorService idgeneratorService;
@Autowired
private StaffLeaveService staffLeaveService;
@Autowired
private AttendanceGroupStaffService attendanceGroupStaffService;
@Override
protected String getExtKey(StaffEntity data) {
......@@ -201,7 +201,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
if (staffCollect.size() > 0) {
//需要将此人员变更为离职
staffCollect.entrySet().stream().forEach(item -> {
String key = item.getKey();
......@@ -243,6 +242,12 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if (count == 0) {
staffLeaveService.save(staffLeaveEntity);
}
//考勤人员中有离职的 删除
Long[] groudStaffIds = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId())).stream().toArray(Long[]::new);
if (!ObjectUtils.isEmpty(groudStaffIds)) {
attendanceGroupStaffService.remove(groudStaffIds, null);
}
}
});
}
......
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