云
2026-10-25 d54fbc9d4f8981fa0f7f613b33a28a8cd4f764ea
yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/service/salary/HrmSalaryStructureServiceImpl.java
@@ -4,6 +4,7 @@
import cn.iocoder.yudao.module.hrm.controller.admin.salary.vo.HrmSalaryStructurePageReqVO;
import cn.iocoder.yudao.module.hrm.dal.dataobject.salary.HrmSalaryStructureDO;
import cn.iocoder.yudao.module.hrm.dal.mysql.salary.HrmSalaryStructureMapper;
import cn.iocoder.yudao.module.hrm.dal.mysql.salary.HrmEmployeeSalaryMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -12,6 +13,7 @@
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.hrm.enums.ErrorCodeConstants.SALARY_STRUCTURE_NOT_EXISTS;
import static cn.iocoder.yudao.module.hrm.enums.ErrorCodeConstants.SALARY_STRUCTURE_IN_USE;
/**
 * 薪酬结构 Service 实现类
@@ -24,6 +26,8 @@
    @Resource
    private HrmSalaryStructureMapper structureMapper;
    @Resource
    private HrmEmployeeSalaryMapper employeeSalaryMapper;
    @Override
    public Long createStructure(HrmSalaryStructureDO structure) {
@@ -40,6 +44,9 @@
    @Override
    public void deleteStructure(Long id) {
        validateStructureExists(id);
        if (employeeSalaryMapper.selectCountByStructureId(id) > 0) {
            throw exception(SALARY_STRUCTURE_IN_USE);
        }
        structureMapper.deleteById(id);
    }
@@ -64,4 +71,4 @@
        }
    }
}
}