DeviceLocationService.java 1.63 KB
package cn.com.glsx.stdinterface.modules.service;

import cn.com.glsx.stdinterface.dto.DeviceLocationDto;
import cn.com.glsx.stdinterface.modules.mapper.DeviceLocationMapper;
import cn.com.glsx.stdinterface.modules.model.LocationCheckBO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * 设备上点 serviceImpl
 *
 * @author yll
 */

@Slf4j
@Service
public class DeviceLocationService {

    @Autowired
    private DeviceLocationMapper deviceLocationMapper;

    /**
     * 插入或者更新设备上点数据
     *
     * @param deviceLocationDtoList
     */
    public void dropLibrary(Collection<DeviceLocationDto> deviceLocationDtoList) {
        try {
            Integer num = deviceLocationMapper.batchInsertOrUpdate(deviceLocationDtoList);
            log.info("saveOrUpdateDeviceLocationData===" + num);
        } catch (Exception e) {
            log.error("saveOrUpdateDeviceLocationData===" + e.getMessage());
            e.printStackTrace();
        }
    }

    /**
     * 获取E盾中的所有设备号集合
     *
     * @return
     */
    public List<String> getAllSnInNewEshield() {
        return deviceLocationMapper.selectAllSn();
    }

    /**
     * 获取E盾中的所有上点数据集合
     *
     * @return
     */
    public List<DeviceLocationDto> getAllDeviceLocationData() {
        return deviceLocationMapper.getAllDeviceLocationData();
    }

    /**
     * 位置验证
     *
     * @param checkBO
     */
    public void locationCheck(LocationCheckBO checkBO) {

    }
}