吉安感知网项目-后端
linwei
2026-01-28 c04afebf9cebfd65bf55c2395e732f36f558d208
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -37,6 +37,8 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.StringUtil;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -79,8 +81,8 @@
   }
   @Override
   public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status) {
      return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status);
   public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) {
      return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack);
   }
@@ -123,8 +125,8 @@
   }
   @Override
   public List<DeviceStatisticsVO> getDeviceOutStatistics() {
      return baseMapper.getDeviceOutStatistics();
   public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) {
      return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull);
   }
   @Override
@@ -145,4 +147,23 @@
   public Map<Long, String> selectSceneNameByDeviceIds(List<Long> deviceIds) {
      return fwAreaDivideService.selectSceneNameByDeviceIds(deviceIds);
   }
   @Override
   public boolean existsAreaBindByDeviceId(Long deviceId) {
      return fwAreaDivideService.existsAreaByDeviceId(deviceId);
   }
   /**
    * 保存或更新设备信息
    * @param fwDeviceEntity
    * @return
    */
   @Override
   public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) {
      if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0 ) {
         fwDeviceEntity.setLatitude("");
         fwDeviceEntity.setLongitude("");
      }
      return saveOrUpdate(fwDeviceEntity);
   }
}