| | |
| | | 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; |
| | |
| | | |
| | | 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 实现类 |
| | |
| | | |
| | | @Resource |
| | | private HrmSalaryStructureMapper structureMapper; |
| | | @Resource |
| | | private HrmEmployeeSalaryMapper employeeSalaryMapper; |
| | | |
| | | @Override |
| | | public Long createStructure(HrmSalaryStructureDO structure) { |
| | |
| | | @Override |
| | | public void deleteStructure(Long id) { |
| | | validateStructureExists(id); |
| | | if (employeeSalaryMapper.selectCountByStructureId(id) > 0) { |
| | | throw exception(SALARY_STRUCTURE_IN_USE); |
| | | } |
| | | structureMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |