package org.springblade.modules.sign.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.sign.dto.SignDTO;
import org.springblade.modules.sign.entity.SignEntity;
import org.springblade.modules.sign.excel.SignExcel;
import org.springblade.modules.sign.excel.SignExceptionExcel;
import org.springblade.modules.sign.mapper.SignMapper;
import org.springblade.modules.sign.service.ISignService;
import org.springblade.modules.sign.vo.BmVO;
import org.springblade.modules.sign.vo.SignExceptionVO;
import org.springblade.modules.sign.vo.SignVO;
import org.springblade.modules.sign.vo.SignVOS;
import org.springblade.modules.system.entity.User;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 考勤 服务实现类
 *
 * @author BladeX
 * @since 2023-07-07
 */
@Service
public class SignServiceImpl extends BaseServiceImpl<SignMapper, SignEntity> implements ISignService {

	@Override
	public IPage<SignVO> selectSignPage(IPage<SignVO> page, SignVO signVOa) {
		return page.setRecords(baseMapper.selectSignPage(page, signVOa));
	}

	@Override
	public List<SignExcel> exportSign(Wrapper<SignEntity> queryWrapper) {
		List<SignExcel> SignList = baseMapper.exportSign(queryWrapper);
		//SignList.forEach(Sign -> {
		//	Sign.setTypeName(DictCache.getValue(DictEnum.YES_NO, Sign.getType()));
		//});
		return SignList;
	}

	@Override
	public List<SignEntity> selectDkjlByUserid(Long userId, String yf) {
		return baseMapper.selectDkjlByUserid(userId, yf);
	}

	@Override
	public int getKgCs(Map<String, Object> params) {
		return baseMapper.getKgCs(params);
	}

	@Override
	public List<SignDTO> getSignUser() {
		return baseMapper.getSignUser();
	}

	@Override
	public void autoAbsent(SignEntity signEntity) {
		baseMapper.autoAbsent(signEntity);
	}

	@Override
	public List<SignVOS> selectSign(Long userId, String Mathvalue) {
		return baseMapper.selectSign(userId, Mathvalue);
	}

	@Override
	public List<BmVO> selectBm(String deptId) {
		return baseMapper.selectBm(deptId);
	}

	@Override
	public IPage<SignVO> selectSignUser(IPage<SignVO> page, SignVO signVOa) {
		return page.setRecords(baseMapper.selectSignUser(page, signVOa));
	}

	@Override
	public List<User> getUserListByRoleId() {
		return baseMapper.getUserListByRoleId();
	}

	@Override
	public IPage<SignExceptionVO> getSignException(IPage<SignExceptionVO> page, Map<String, Object> params) {
		return page.setRecords(baseMapper.getSignException(page, params));
	}

	@Override
	public List<SignExceptionExcel> exportInfo(Map<String, Object> params) {
		return baseMapper.exportInfo(params);
	}

	@Override
	public SignEntity getSignZpById(Map<String, Object> params) {
		return baseMapper.getSignZpById(params);
	}

	@Override
	public String getRqType() {
		return baseMapper.getRqType();
	}
}
