package com.gkhy.safePlatform.account.service.baseService.impl;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfo;
|
import com.gkhy.safePlatform.account.entity.schedule.WorkTimePeriodInfoDO;
|
import com.gkhy.safePlatform.account.entity.user.UserInfoDO;
|
import com.gkhy.safePlatform.account.model.dto.req.WorkTimePeriodReqDTO;
|
import com.gkhy.safePlatform.account.model.dto.resp.WorkTimePeriodRespDTO;
|
import com.gkhy.safePlatform.account.model.query.db.AccountDBQuery;
|
import com.gkhy.safePlatform.account.repository.schedule.WorkTimePeriodInfoRepository;
|
import com.gkhy.safePlatform.account.service.WorkTimeService;
|
import com.gkhy.safePlatform.account.service.baseService.WorkTimePeriodInfoService;
|
import com.gkhy.safePlatform.commons.enums.ResultCodes;
|
import com.gkhy.safePlatform.commons.exception.BusinessException;
|
import com.gkhy.safePlatform.commons.vo.ResultVO;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
|
@Service("workTimePeriodInfoService")
|
public class WorkTimePeriodInfoServiceImpl extends ServiceImpl<WorkTimePeriodInfoRepository,WorkTimePeriodInfo> implements WorkTimePeriodInfoService {
|
@Autowired
|
private WorkTimePeriodInfoRepository workTimePeriodInfoRepository;
|
|
/**
|
* 新增时间段
|
* @param workTimePeriodInfo
|
* @return
|
*/
|
@Override
|
public int saveWorkTimePeriodInfo(WorkTimePeriodInfo workTimePeriodInfo) {
|
return workTimePeriodInfoRepository.insert(workTimePeriodInfo);
|
}
|
|
/**
|
* 编辑时间段
|
*
|
* @param workTimePeriodInfo
|
* @return
|
*/
|
@Override
|
public int updateWorkTimePeriodInfo(WorkTimePeriodInfo workTimePeriodInfo) {
|
return workTimePeriodInfoRepository.updateById(workTimePeriodInfo);
|
}
|
|
/**
|
* 获取所有工作时间段
|
* @param workTimePeriodInfo
|
* @return
|
*/
|
@Override
|
public List<WorkTimePeriodInfo> getWorkTimePeriod(WorkTimePeriodInfo workTimePeriodInfo) {
|
return workTimePeriodInfoRepository.getWorkTimePeriod(workTimePeriodInfo);
|
}
|
|
@Override
|
public List<WorkTimePeriodInfoDO> getWorkTimePeriodsByWorkTimeGroupId(Long workTimeGroupId) {
|
if (workTimeGroupId == null) {
|
throw new BusinessException(ResultCodes.SERVER_PARAM_NULL);
|
}
|
return workTimePeriodInfoRepository.getWorkTimePeriodsByWorkTimeGroupId(workTimeGroupId);
|
}
|
|
|
/**
|
* 分页查询
|
*/
|
public List<WorkTimePeriodInfo> getWorkTimePeriodByPage(Page<WorkTimePeriodInfo> page, WorkTimePeriodInfo query) {
|
return workTimePeriodInfoRepository.getWorkTimePeriod(page,query);
|
}
|
}
|