xiaoyi
3 天以前 319f1ff78c96c770c66dd9a77beed3fdba284122
yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/attendance/HrmAttendanceExceptionServiceImpl.java
@@ -12,6 +12,8 @@
import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi;
import cn.iocoder.yudao.module.hrm.dal.redis.HrmNoRedisDAO;
import cn.iocoder.yudao.module.hrm.enums.HrmAuditStatusEnum;
import cn.iocoder.yudao.module.hrm.dal.dataobject.employee.HrmEmployeeDO;
import cn.iocoder.yudao.module.hrm.service.employee.HrmEmployeeService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -26,7 +28,7 @@
/**
 * 考勤异常申请 Service 实现类
 *
 * @author 芋道源码
 * @author 超级管理员
 */
@Service
@Validated
@@ -43,10 +45,18 @@
    private StorageAttachmentApi storageAttachmentApi;
    @Resource
    private BpmProcessDefinitionService bpmProcessDefinitionService;
    @Resource
    private HrmEmployeeService employeeService;
    @Override
    public Long createAttendanceException(HrmAttendanceExceptionSaveReqVO createReqVO) {
        HrmEmployeeDO employee = employeeService.getEmployeeByUserId(
                cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId());
        if (employee == null) {
            throw exception(EMPLOYEE_NOT_EXISTS);
        }
        HrmAttendanceExceptionDO attendanceException = BeanUtils.toBean(createReqVO, HrmAttendanceExceptionDO.class);
        attendanceException.setUserId(employee.getId()).setDeptId(employee.getDeptId());
        attendanceException.setNo(generateNo());
        attendanceException.setStatus(HrmAuditStatusEnum.DRAFT.getStatus());
        attendanceExceptionMapper.insert(attendanceException);