吉安感知网项目-后端
linwei
3 days ago 51a551a7f8eae7654f973d45cd2fa2952774673d
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwDefenseSceneManageServiceImpl.java
@@ -16,8 +16,11 @@
 */
package org.sxkj.fw.area.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.sxkj.fw.area.param.FwDefenseSceneManagePageParam;
import org.sxkj.fw.area.entity.FwDefenseSceneManageEntity;
@@ -29,10 +32,13 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.sxkj.fw.common.FwBaseInfo;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.system.cache.SysCache;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -41,6 +47,7 @@
 * @author Aix
 * @since 2026-01-30
 */
@Slf4j
@Service
public class FwDefenseSceneManageServiceImpl extends BaseServiceImpl<FwDefenseSceneManageMapper, FwDefenseSceneManageEntity> implements IFwDefenseSceneManageService {
@@ -49,6 +56,10 @@
   @Override
   public IPage<FwDefenseSceneManageVO> selectFwDefenseSceneManagePage(IPage<FwDefenseSceneManageVO> page, FwDefenseSceneManagePageParam fwDefenseSceneManagePageParam) {
      if (!AuthUtil.isAdministrator()) {
         List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
         fwDefenseSceneManagePageParam.setDeptList(deptList);
      }
      return page.setRecords(baseMapper.selectFwDefenseSceneManagePage(page, fwDefenseSceneManagePageParam));
   }
@@ -93,6 +104,7 @@
    */
   @Override
   public boolean deleteFwDefenseSceneManage(List<Long> longList) {
      // 删除场景管理
      boolean b = deleteLogic(longList);
      if (b) {
         // 1.遍历所有删除的场景管理ID
@@ -101,6 +113,9 @@
            // 2.获取场景管理下的所有设备ID
            List<Long> deviceIdList = baseMapper.selectDeviceId(sceneManageId);
            AllDeviceId.addAll(deviceIdList);
         }
         if (AllDeviceId == null || AllDeviceId.isEmpty()) {
            return true;
         }
         // 3.禁用设备
         return fwDeviceService.update(Wrappers.<FwDeviceEntity>lambdaUpdate()
@@ -120,4 +135,10 @@
   public List<Long> selectDeviceId(Long sceneManageId) {
      return baseMapper.selectDeviceId(sceneManageId);
   }
   @Override
   public List<FwDefenseSceneManageVO> selectFwDefenseSceneManageCockpitList(FwBaseInfo fwBaseInfo, Date time) {
      log.info("fwBaseInfo信息:{}", JSON.toJSONString(fwBaseInfo));
      return baseMapper.selectFwDefenseSceneManageCockpitList(fwBaseInfo, time);
   }
}