package com.crm.manager.service.impl;

import com.crm.manager.dao.mapper.ControlPanelStatisticsMapper;
import com.crm.manager.service.ControlPanelService;
import com.crm.rely.backend.core.exception.ServiceException;
import com.crm.rely.backend.model.dto.statistics.ManagerStatisticsDto;
import com.crm.rely.backend.model.pojo.view.ControlPanelManagerApplyNumberView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: houn
 * @Date: 2020/8/13 13:55
 * @Description:
 */
@Service
public class ControlPanelServiceImpl implements ControlPanelService {

    @Autowired
    private ControlPanelStatisticsMapper controlPanelStatisticsMapper;

    @Override
    public ManagerStatisticsDto managerStatistics() throws ServiceException {

        ControlPanelManagerApplyNumberView controlPanelApplyNumberView = controlPanelStatisticsMapper.searchManagerApplyNumber();

        ManagerStatisticsDto managerStatisticsDto = new ManagerStatisticsDto();
        BeanUtils.copyProperties(controlPanelApplyNumberView, managerStatisticsDto);
        return managerStatisticsDto;
    }

}
