吉安感知网项目-后端
rain
2026-01-29 c39de0df2cb8b9964228fd735bcec9c3332791a1
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceScrapServiceImpl.java
@@ -57,11 +57,13 @@
   @Override
   @Transactional
   public boolean saveFwDeviceScrap(FwDeviceScrapDTO dto) {
      // 先保存报废记录,成功后再处理设备状态与逻辑删除
      boolean isSuccess = super.save(FwDeviceScrapWrapper.build().entityDTO(dto));
      if (isSuccess) {
         FwDeviceEntity fwDevice = new FwDeviceEntity();
         fwDevice.setId(dto.getDeviceId());
         fwDevice.setStatus(3);
         // 更新设备状态并做逻辑删除,保持报废与设备状态一致
         isSuccess = fwDeviceService.updateById(fwDevice) && fwDeviceService.deleteLogic(Collections.singletonList(fwDevice.getId()));
      }
      return isSuccess;
@@ -69,6 +71,7 @@
   @Override
   public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap) {
      // 按当前部门及下级部门范围过滤数据
      List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
      fwDeviceScrap.setDeptList(deptList);
      return page.setRecords(baseMapper.selectFwDeviceScrapPage(page, fwDeviceScrap));