| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.mapper.PersonalShiftMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2026-02-11 09:41:34 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class PersonalAttendanceLocationConfigServiceImpl extends ServiceImpl<PersonalAttendanceLocationConfigMapper, PersonalAttendanceLocationConfig> implements PersonalAttendanceLocationConfigService { |
| | | |
| | | private final PersonalShiftMapper personalShiftMapper; |
| | | |
| | | @Override |
| | | public boolean hasAttendanceUsage(Integer configId) { |
| | | if (configId == null) { |
| | | return false; |
| | | } |
| | | return personalShiftMapper.existsAttendanceUsedByConfig(configId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean canEdit(Integer configId) { |
| | | return !hasAttendanceUsage(configId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean canDelete(Integer configId) { |
| | | return !hasAttendanceUsage(configId); |
| | | } |
| | | } |