package com.skr.mdm.api.index.service.impl;

import com.skr.mdm.api.index.service.DeviceDistributionService;
import com.skr.mdm.dao.DeviceEquipmentDao;
import com.skr.mdm.dto.LoginAdminDTO;
import com.skr.mdm.result.ResponseResult;
import com.skr.mdm.bean.qo.controller.SelectDeviceQO;
import com.skr.mdm.bean.vo.DeviceDistributionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ProjectName: mdm_new
 * @Package: com.skr.mdm.largeScreenManagement.service.serviceImpl
 * @ClassName: DeviceDistributionServiceImpl
 * @Author: Tty
 * @Description: 设备实现接口
 * @Date: 2020/9/16 16:38
 * @Version: 1.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceDistributionServiceImpl implements DeviceDistributionService {
	@Autowired
	private DeviceEquipmentDao deviceEquipmentDao;

	@Override
	public ResponseResult deviceDistributionList(LoginAdminDTO admin, SelectDeviceQO selectDeviceQO) throws Exception {
		selectDeviceQO.setCompanyId(admin.getCompanyId());
		List<DeviceDistributionVO> deviceDistributionVOS = deviceEquipmentDao.queryDistributionList(selectDeviceQO);
		return ResponseResult.success(deviceDistributionVOS);
	}

}
