fix: default dispatchStatus/empStatus for employee create
This commit is contained in:
@@ -80,6 +80,10 @@ public class EmployeeService {
|
||||
throw new BusinessException(ErrorCode.DUPLICATE_LOGIN_ID);
|
||||
}
|
||||
|
||||
if (employee.getRoleCode() == null) employee.setRoleCode(RoleCode.EMPLOYEE);
|
||||
if (employee.getEmpStatus() == null) employee.setEmpStatus(EmpStatus.ACTIVE);
|
||||
if (employee.getDispatchStatus() == null) employee.setDispatchStatus(DispatchStatus.WAITING);
|
||||
|
||||
employee.setPassword(passwordEncoder.encode(employee.getPassword()));
|
||||
return employeeRepository.save(employee);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user