吉安感知网项目-后端
linwei
2026-01-28 016caee2dd92a8c352834c382fd340b39fddc9ab
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java
@@ -33,9 +33,13 @@
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import org.sxkj.fw.common.GenericConverter;
import org.sxkj.fw.common.IdParam;
import org.sxkj.fw.device.dto.FwDeviceTrackDTO;
import org.sxkj.fw.device.entity.FwDeviceTrackEntity;
import org.sxkj.fw.device.excel.FwDeviceTrackExcel;
import org.sxkj.fw.device.param.FwDeviceTrackPageParam;
import org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.fw.device.service.IFwDeviceTrackService;
import org.sxkj.fw.device.vo.FwDeviceTrackVO;
import org.sxkj.fw.device.wrapper.FwDeviceTrackWrapper;
@@ -59,6 +63,7 @@
public class FwDeviceTrackController extends BladeController {
   private final IFwDeviceTrackService fwDeviceTrackService;
   private final IFwDeviceService fwDeviceService;
   /**
    * 设备跟踪流转表 详情
@@ -66,8 +71,8 @@
   @GetMapping("/detail")
   @ApiOperationSupport(order = 1)
   @ApiOperation(value = "详情", notes = "传入fwDeviceTrack")
   public R<FwDeviceTrackVO> detail(FwDeviceTrackDTO fwDeviceTrack) {
      FwDeviceTrackEntity detail = fwDeviceTrackService.getOne(Condition.getQueryWrapper(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack)));
   public R<FwDeviceTrackVO> detail(IdParam fwDeviceTrack) {
      FwDeviceTrackEntity detail = fwDeviceTrackService.getOne(Condition.getQueryWrapper(GenericConverter.convert(fwDeviceTrack, FwDeviceTrackEntity.class)));
      if (detail == null) {
         return R.fail("该记录不存在");
@@ -82,8 +87,8 @@
   @GetMapping("/page")
   @ApiOperationSupport(order = 2)
   @ApiOperation(value = "分页", notes = "传入fwDeviceTrack")
   public R<IPage<FwDeviceTrackVO>> page(FwDeviceTrackDTO fwDeviceTrack, Query query) {
      IPage<FwDeviceTrackEntity> pages = fwDeviceTrackService.selectFwDeviceTrackPage(Condition.getPage(query), fwDeviceTrack);
   public R<IPage<FwDeviceTrackVO>> page(FwDeviceTrackPageParam fwDeviceTrack, Query query) {
      IPage<FwDeviceTrackEntity> pages = fwDeviceTrackService.selectFwDeviceTrackPage(Condition.getPage(query), GenericConverter.convert(fwDeviceTrack, FwDeviceTrackDTO.class));
      return R.data(FwDeviceTrackWrapper.build().pageVO(pages));
   }
@@ -94,7 +99,17 @@
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入fwDeviceTrack")
   public R submit(@Valid @RequestBody FwDeviceTrackDTO fwDeviceTrack) {
      return R.status(fwDeviceTrackService.saveOrUpdate(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack)));
      if (null == fwDeviceTrack.getDeviceId()) {
         return R.fail("设备ID不能为空");
      }
      boolean saved = fwDeviceTrackService.saveOrUpdate(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack));
      if (!saved) {
         return R.status(false);
      }
      return R.status(fwDeviceService.updateTrackStatusByDeviceId(fwDeviceTrack.getDeviceId(), 1));
   }
   /**