吉安感知网项目-后端
linwei
2026-01-09 bbc3d8a4b43256e6cafefc7ab33f34e1459aed9b
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceScrapServiceImpl.java
@@ -16,15 +16,22 @@
 */
package org.sxkj.fw.device.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.mapper.FwDeviceScrapMapper;
import org.sxkj.fw.device.service.IFwDeviceScrapService;
import org.springframework.stereotype.Service;
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.device.service.IFwDeviceService;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper;
import java.util.List;
/**
@@ -34,10 +41,26 @@
 * @since 2026-01-08
 */
@Service
@AllArgsConstructor
public class FwDeviceScrapServiceImpl extends BaseServiceImpl<FwDeviceScrapMapper, FwDeviceScrapEntity> implements IFwDeviceScrapService {
   private final IFwDeviceService fwDeviceService;
   @Override
   public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapVO fwDeviceScrap) {
   @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);
      }
      return isSuccess;
   }
   @Override
   public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap) {
      return page.setRecords(baseMapper.selectFwDeviceScrapPage(page, fwDeviceScrap));
   }