package com.bonus.system.att.service;

import com.bonus.common.core.constant.HttpStatus;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.system.att.dao.AttDetailByMonthDao;
import com.bonus.system.att.dao.AttExceptionHandleDao;
import com.bonus.system.att.dao.AttExceptionHandleDao2;
import com.bonus.system.att.entity.AttExceptionBean;
import com.bonus.system.basic.dao.SysOrgDao;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 轮休临时外出异常数据-业务层
 * @author hongchao
 */
@Service("attExceptionHandle2")
@Slf4j
public class AttExceptionHandleServiceImpl2 implements AttExceptionHandleService2{

    /*@Resource(name = "attExceptionHandleDao2")
    private AttExceptionHandleDao2 attExceptionHandleDao;

    @Resource(name = "attDetailByMonthDao")
    private AttDetailByMonthDao attDetailByMonthDao;

    @Resource
    private SysOrgDao orgDao;

    @Override
    public TableDataInfo selectAttExceptionList(AttExceptionBean data)
    {
        List<AttExceptionBean> list = new ArrayList<>();
        try {
            list = attExceptionHandleDao.selectAttExceptionList(data);
            list.forEach(item -> {
                item.setNoFinishCount(item.getErrorCount()-item.getFinishCount());
            });
        } catch (Exception e) {
            log.error("查询异常数据", e);
        }
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setRows(list);
        rspData.setMsg("查询成功");
        rspData.setTotal(new PageInfo(list).getTotal());
        return rspData;
    }

    @Override
    public List<AttExceptionBean> getDetailException(AttExceptionBean data)
    {
        List<AttExceptionBean> list = new ArrayList<>();
        try {
                list = attExceptionHandleDao.getDetailException(data);
        } catch (Exception e) {
            log.error("查询轮休临时外出异常数据详细信息", e);
        }
        return list;
    }*/



}
