From a381426bb74009f45db150beadb9f67ea72a7df5 Mon Sep 17 00:00:00 2001
From: rain <1679827795@qq.com>
Date: Thu, 22 Jan 2026 16:00:55 +0800
Subject: [PATCH] 事件线索app相关接口

---
 drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java |   48 ++++++++++++++++++------------------------------
 1 files changed, 18 insertions(+), 30 deletions(-)

diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java
index a3cc6de..ac86bd2 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdManageDeviceController.java
@@ -31,6 +31,9 @@
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.sxkj.gd.common.GenericConverter;
+import org.sxkj.gd.common.IdParam;
+import org.sxkj.gd.workorder.dto.GdManageDeviceDTO;
 import org.sxkj.gd.workorder.entity.GdManageDeviceEntity;
 import org.sxkj.gd.workorder.vo.GdManageDeviceVO;
 import org.sxkj.gd.workorder.excel.GdManageDeviceExcel;
@@ -65,19 +68,23 @@
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入gdManageDevice")
-	public R<GdManageDeviceVO> detail(GdManageDeviceEntity gdManageDevice) {
-		GdManageDeviceEntity detail = gdManageDeviceService.getOne(Condition.getQueryWrapper(gdManageDevice));
+	public R<GdManageDeviceVO> detail(@Valid IdParam manageDevice) {
+		GdManageDeviceEntity detail = gdManageDeviceService.getOne(Condition.getQueryWrapper(GenericConverter.convert(manageDevice, GdManageDeviceEntity.class)));
+		if (detail == null) {
+			return R.fail("该设备不存在");
+		}
 		return R.data(GdManageDeviceWrapper.build().entityVO(detail));
 	}
+
 	/**
-	 * 设备信息 分页
+	 * 设备信息 自定义分页
 	 */
 	@GetMapping("/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入gdManageDevice")
-	public R<IPage<GdManageDeviceVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdManageDevice, Query query) {
-		IPage<GdManageDeviceEntity> pages = gdManageDeviceService.page(Condition.getPage(query), Condition.getQueryWrapper(gdManageDevice, GdManageDeviceEntity.class));
-		return R.data(GdManageDeviceWrapper.build().pageVO(pages));
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "不分页", notes = "传入gdManageDevice")
+	public R<List<GdManageDeviceVO>> page(GdManageDeviceVO gdManageDevice) {
+		List<GdManageDeviceVO> pages = gdManageDeviceService.selectGdManageDevice(gdManageDevice);
+		return R.data(pages);
 	}
 
 	/**
@@ -92,33 +99,13 @@
 	}
 
 	/**
-	 * 设备信息 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入gdManageDevice")
-	public R save(@Valid @RequestBody GdManageDeviceEntity gdManageDevice) {
-		return R.status(gdManageDeviceService.save(gdManageDevice));
-	}
-
-	/**
-	 * 设备信息 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入gdManageDevice")
-	public R update(@Valid @RequestBody GdManageDeviceEntity gdManageDevice) {
-		return R.status(gdManageDeviceService.updateById(gdManageDevice));
-	}
-
-	/**
 	 * 设备信息 新增或修改
 	 */
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入gdManageDevice")
-	public R submit(@Valid @RequestBody GdManageDeviceEntity gdManageDevice) {
-		return R.status(gdManageDeviceService.saveOrUpdate(gdManageDevice));
+	public R submit(@Valid @RequestBody GdManageDeviceDTO gdManageDevice) {
+		return R.status(gdManageDeviceService.saveOrUpdate(GdManageDeviceWrapper.build().entityDTO(gdManageDevice)));
 	}
 
 	/**
@@ -137,6 +124,7 @@
 	 */
 	@GetMapping("/export-gdManageDevice")
 	@ApiOperationSupport(order = 9)
+	@ApiIgnore
 	@ApiOperation(value = "导出数据", notes = "传入gdManageDevice")
 	public void exportGdManageDevice(@ApiIgnore @RequestParam Map<String, Object> gdManageDevice, BladeUser bladeUser, HttpServletResponse response) {
 		QueryWrapper<GdManageDeviceEntity> queryWrapper = Condition.getQueryWrapper(gdManageDevice, GdManageDeviceEntity.class);

--
Gitblit v1.9.3