|
@@ -120,7 +120,7 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- if(CollectionUtil.isNotEmpty(us)){
|
|
|
+ if (CollectionUtil.isNotEmpty(us)) {
|
|
|
CommonResult<List<AdminUserRespDTO>> result = userApi.getUsers(us);
|
|
|
if (result.getCode() != 0) {
|
|
|
throw new RuntimeException(result.getMsg());
|
|
@@ -156,13 +156,13 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
throw exception(STAFF_NOT_EXISTS);
|
|
|
}
|
|
|
RecordsRespVO vo = RecordsConvert.INSTANCE.convertDetail(staffRecordSDO);
|
|
|
- System.out.println(vo.getJg());
|
|
|
vo.setHtqdsj(staffRecordSDO.getHtqdsj());
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
|
if (vo.getYsrzsj() != null) {
|
|
|
LocalDateTime enterTime = staffRecordSDO.getYsrzsj();
|
|
|
- int companyYear = Math.toIntExact(ChronoUnit.YEARS.between(enterTime, now));
|
|
|
+ int companyYear = now.getYear() - enterTime.getYear();
|
|
|
+ System.out.println(companyYear);
|
|
|
int initYear = vo.getCssl() == null ? 0 : vo.getCssl();
|
|
|
vo.setSl(companyYear + initYear);
|
|
|
} else if (vo.getRgssj() != null) {
|
|
@@ -272,13 +272,16 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
|
|
|
|
|
|
//更新档案
|
|
|
+ if (staffRecordSDO.getYsrzsj() == null) {
|
|
|
+ staffRecordSDO.setYsrzsj(null);
|
|
|
+ }
|
|
|
recordsMapper.update(staffRecordSDO, new LambdaQueryWrapperX<StaffRecordSDO>().eq(StaffRecordSDO::getUserId, vo.getUserId()));
|
|
|
|
|
|
//远程更新部门 若该员工的修改状态为离职则关闭其账号 其余关联关系保持不变
|
|
|
UserUpdateDTO dto = new UserUpdateDTO();
|
|
|
dto.setUserId(vo.getUserId());
|
|
|
dto.setDeptId(vo.getDeptId());
|
|
|
- dto.setState(vo.getState().toString());
|
|
|
+ dto.setState(vo.getState());
|
|
|
CommonResult<Boolean> close = userApi.updateUserDept(dto);
|
|
|
if (close.getCode() != 0) {
|
|
|
throw new RuntimeException(close.getMsg());
|