diff --git a/pom.xml b/pom.xml
index f22b25b..91b26d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,6 +28,12 @@
tuoheng-api-device
+
+
+ com.ruoyi
+ ruoyi-api-system
+
+
com.ruoyi
diff --git a/src/main/java/com/ruoyi/device/TuohengDeviceApplication.java b/src/main/java/com/ruoyi/device/TuohengDeviceApplication.java
index 5722b39..f1111f0 100644
--- a/src/main/java/com/ruoyi/device/TuohengDeviceApplication.java
+++ b/src/main/java/com/ruoyi/device/TuohengDeviceApplication.java
@@ -2,6 +2,7 @@ package com.ruoyi.device;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
@@ -14,11 +15,15 @@ import com.ruoyi.common.security.annotation.EnableRyFeignClients;
@EnableScheduling
@EnableCustomConfig
@EnableRyFeignClients
+@ComponentScan(basePackages = {"com.ruoyi"})
@SpringBootApplication
public class TuohengDeviceApplication
{
+
+
public static void main(String[] args)
{
+
SpringApplication.run(TuohengDeviceApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 设备模块启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
diff --git a/src/main/java/com/ruoyi/device/api/domain/AirTypeVendorGroupVO.java b/src/main/java/com/ruoyi/device/api/domain/AirTypeVendorGroupVO.java
new file mode 100644
index 0000000..c395a58
--- /dev/null
+++ b/src/main/java/com/ruoyi/device/api/domain/AirTypeVendorGroupVO.java
@@ -0,0 +1,35 @@
+package com.ruoyi.device.api.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 无人机厂商分组VO
+ *
+ * @author ruoyi
+ * @date 2026-01-29
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class AirTypeVendorGroupVO extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 厂商标签
+ */
+ private String label;
+
+ /**
+ * 厂商值
+ */
+ private String value;
+
+ /**
+ * 无人机类型列表
+ */
+ private List airTypeList;
+
+}
diff --git a/src/main/java/com/ruoyi/device/controller/AirTypeGeneralEnumController.java b/src/main/java/com/ruoyi/device/controller/AirTypeGeneralEnumController.java
index 83e1b0d..ff57416 100644
--- a/src/main/java/com/ruoyi/device/controller/AirTypeGeneralEnumController.java
+++ b/src/main/java/com/ruoyi/device/controller/AirTypeGeneralEnumController.java
@@ -1,13 +1,17 @@
package com.ruoyi.device.controller;
+import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.device.api.domain.AirTypeGeneralEnumVO;
+import com.ruoyi.device.api.domain.AirTypeVendorGroupVO;
import com.ruoyi.device.api.domain.DockVO;
import com.ruoyi.device.controller.convert.AirTypeGeneralEnumVOConvert;
import com.ruoyi.device.controller.convert.DockVOConvert;
import com.ruoyi.device.service.api.IAirTypeGeneralEnumService;
import com.ruoyi.device.service.dto.AirTypeGeneralEnumDTO;
+import com.ruoyi.system.api.RemoteDictService;
+import com.ruoyi.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -15,7 +19,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* 无人机类型通用枚举Controller
@@ -24,12 +31,15 @@ import java.util.List;
* @date 2026-01-28
*/
@RestController
-@RequestMapping("/air-type-general-enum")
+@RequestMapping("/airType/generalEnum")
public class AirTypeGeneralEnumController extends BaseController
{
@Autowired
private IAirTypeGeneralEnumService airTypeGeneralEnumService;
+ @Autowired
+ private RemoteDictService remoteDictService;
+
/**
* 查询无人机类型通用枚举列表
*
@@ -44,4 +54,48 @@ public class AirTypeGeneralEnumController extends BaseController
List voList = AirTypeGeneralEnumVOConvert.fromList(list);
return R.ok(voList);
}
+
+ /**
+ * 按厂商分组查询无人机类型
+ *
+ * @return 按厂商分组的无人机类型列表
+ */
+ @GetMapping("/vendorGroup")
+ public R> selectAirTypeGeneralEnumGroupByVendor()
+ {
+ // 从数据字典获取无人机厂商类型
+ R> dictResult = remoteDictService.getDictDataByType("air_vendor_type", SecurityConstants.INNER);
+ List vendorGroupList = new ArrayList<>();
+
+ if (dictResult.getData() != null)
+ {
+ // 获取所有无人机类型数据
+ List allList = airTypeGeneralEnumService.selectAirTypeGeneralEnumList(new AirTypeGeneralEnumDTO());
+ List allVoList = AirTypeGeneralEnumVOConvert.fromList(allList);
+
+ // 为每个字典项创建分组
+ for (SysDictData dictData : dictResult.getData())
+ {
+ AirTypeVendorGroupVO groupVO = new AirTypeVendorGroupVO();
+ groupVO.setLabel(dictData.getDictLabel());
+ groupVO.setValue(dictData.getDictValue());
+
+ // 筛选属于当前厂商的无人机类型
+ List vendorAirTypes = new ArrayList<>();
+ for (AirTypeGeneralEnumVO vo : allVoList)
+ {
+ if (dictData.getDictValue().equals(vo.getVendorId().toString()))
+ {
+ vendorAirTypes.add(vo);
+ }
+ }
+
+ groupVO.setAirTypeList(vendorAirTypes);
+ vendorGroupList.add(groupVO);
+ }
+ }
+
+ return R.ok(vendorGroupList);
+ }
+
}
diff --git a/src/main/java/com/ruoyi/device/controller/convert/AirTypeGeneralEnumVOConvert.java b/src/main/java/com/ruoyi/device/controller/convert/AirTypeGeneralEnumVOConvert.java
index d3cf0a6..5ff7e65 100644
--- a/src/main/java/com/ruoyi/device/controller/convert/AirTypeGeneralEnumVOConvert.java
+++ b/src/main/java/com/ruoyi/device/controller/convert/AirTypeGeneralEnumVOConvert.java
@@ -7,7 +7,10 @@ import com.ruoyi.device.service.dto.AirTypeGeneralEnumDTO;
import java.util.List;
/**
- *无人机类型通用配置
+ * 无人机类型通用枚举Controller转换器
+ *
+ * @author 拓恒
+ * @date 2026-01-20
*/
public class AirTypeGeneralEnumVOConvert extends BaseConvert
{
diff --git a/src/main/java/com/ruoyi/device/domain/model/AirTypeGeneralEnum.java b/src/main/java/com/ruoyi/device/domain/model/AirTypeGeneralEnum.java
index 48ed70e..a6ab484 100644
--- a/src/main/java/com/ruoyi/device/domain/model/AirTypeGeneralEnum.java
+++ b/src/main/java/com/ruoyi/device/domain/model/AirTypeGeneralEnum.java
@@ -26,140 +26,20 @@ public class AirTypeGeneralEnum extends BaseEntity
/** 名称 */
private String name;
+ /** 厂商ID */
+ private Long vendorId;
+
/** 领域 */
- private String domain;
+ private Long domain;
/** 主类型 */
- private String type;
+ private Long type;
/** 子类型 */
- private String sub_type;
+ private Long subType;
/** 图标 */
private String icon;
- /** 创建者 */
- private String createBy;
-
- /** 创建时间 */
- private Date createTime;
-
- /** 更新者 */
- private String updateBy;
-
- /** 更新时间 */
- private Date updateTime;
-
- /** 备注 */
- private String remark;
-
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getDomain()
- {
- return domain;
- }
-
- public void setDomain(String domain)
- {
- this.domain = domain;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getSub_type()
- {
- return sub_type;
- }
-
- public void setSub_type(String sub_type)
- {
- this.sub_type = sub_type;
- }
-
- public String getIcon()
- {
- return icon;
- }
-
- public void setIcon(String icon)
- {
- this.icon = icon;
- }
-
- public String getCreateBy()
- {
- return createBy;
- }
-
- public void setCreateBy(String createBy)
- {
- this.createBy = createBy;
- }
-
- public Date getCreateTime()
- {
- return createTime;
- }
-
- public void setCreateTime(Date createTime)
- {
- this.createTime = createTime;
- }
-
- public String getUpdateBy()
- {
- return updateBy;
- }
-
- public void setUpdateBy(String updateBy)
- {
- this.updateBy = updateBy;
- }
-
- public Date getUpdateTime()
- {
- return updateTime;
- }
-
- public void setUpdateTime(Date updateTime)
- {
- this.updateTime = updateTime;
- }
-
- public String getRemark()
- {
- return remark;
- }
-
- public void setRemark(String remark)
- {
- this.remark = remark;
- }
+
}
diff --git a/src/main/java/com/ruoyi/device/mapper/entity/AirTypeGeneralEnumEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/AirTypeGeneralEnumEntity.java
index 3a11b30..393e183 100644
--- a/src/main/java/com/ruoyi/device/mapper/entity/AirTypeGeneralEnumEntity.java
+++ b/src/main/java/com/ruoyi/device/mapper/entity/AirTypeGeneralEnumEntity.java
@@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
- * 无人机表实体对象 device_aircraft
+ * 无人机类型通用枚举表实体对象 air_type_general_enum
* Mapper 层实体,对应数据库表
*
* @author ruoyi
@@ -26,18 +26,23 @@ public class AirTypeGeneralEnumEntity extends BaseEntity {
*/
private String name;
+ /**
+ * 厂商ID
+ */
+ private Long vendorId;
+
/**
* 领域
*/
- private String domain;
+ private Long domain;
/**
* 主类型
*/
- private String type;
+ private Long type;
/**
* 子类型
*/
- private String sub_type;
+ private Long subType;
/**
* 图标
*/
@@ -46,13 +51,14 @@ public class AirTypeGeneralEnumEntity extends BaseEntity {
@Override
public String toString() {
- return "AircraftEntity{" +
- "aircraftId=" + id +
+ return "AirTypeGeneralEnumEntity{" +
+ "id=" + id +
", name='" + name + '\'' +
- ", domain='" + domain + '\'' +
- ", type='" + type + '\'' +
+ ", vendorId=" + vendorId +
+ ", domain=" + domain +
+ ", type=" + type +
", icon='" + icon + '\'' +
- ", sub_type=" + sub_type +
+ ", subType=" + subType +
'}';
}
}
\ No newline at end of file
diff --git a/src/main/java/com/ruoyi/device/service/dto/AirTypeGeneralEnumDTO.java b/src/main/java/com/ruoyi/device/service/dto/AirTypeGeneralEnumDTO.java
index e6977b7..3c39c3b 100644
--- a/src/main/java/com/ruoyi/device/service/dto/AirTypeGeneralEnumDTO.java
+++ b/src/main/java/com/ruoyi/device/service/dto/AirTypeGeneralEnumDTO.java
@@ -26,14 +26,17 @@ public class AirTypeGeneralEnumDTO extends BaseEntity
/** 名称 */
private String name;
+ /** 厂商ID */
+ private Long vendorId;
+
/** 领域 */
- private String domain;
+ private Long domain;
/** 主类型 */
- private String type;
+ private Long type;
/** 子类型 */
- private String sub_type;
+ private Long subType;
/** 图标 */
private String icon;
diff --git a/src/main/resources/db/migration/V5__Create_air_type_general_enum_table.sql b/src/main/resources/db/migration/V5__Create_air_type_general_enum_table.sql
new file mode 100644
index 0000000..ebbcf32
--- /dev/null
+++ b/src/main/resources/db/migration/V5__Create_air_type_general_enum_table.sql
@@ -0,0 +1,54 @@
+
+
+CREATE TABLE IF NOT EXISTS `device_air_type_general_enum` (
+ `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` VARCHAR(255) DEFAULT NULL COMMENT '名称',
+ `vendor_id` BIGINT DEFAULT NULL COMMENT '厂商ID',
+ `domain` BIGINT DEFAULT NULL COMMENT '领域',
+ `type` BIGINT DEFAULT NULL COMMENT '主类型',
+ `sub_type` BIGINT DEFAULT NULL COMMENT '子类型',
+ `icon` VARCHAR(255) DEFAULT NULL COMMENT '图标',
+ `create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
+ `create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
+ `update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
+ `update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
+ `remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='无人机类型通用枚举表';
+
+
+-- Matrice 系列
+INSERT INTO device_air_type_general_enum (name, vendor_id, domain, type, sub_type, remark) VALUES
+ ('Matrice 400', 1, 0, 103, 0, '-'),
+ ('Matrice 350 RTK', 1, 0, 89, 0, '-'),
+ ('Matrice 300 RTK', 1, 0, 60, 0, '-'),
+ ('Matrice 30', 1, 0, 67, 0, '-'),
+ ('Matrice 30T', 1, 0, 67, 1, '-'),
+ ('Matrice 3D', 1, 0, 91, 0, '-'),
+ ('Matrice 3TD', 1, 0, 91, 1, '-'),
+ ('Matrice 4D', 1, 0, 100, 0, '-'),
+ ('Matrice 4TD', 1, 0, 100, 1, '-');
+
+-- Mavic 3 行业系列
+INSERT INTO device_air_type_general_enum (name, vendor_id, domain, type, sub_type, remark) VALUES
+ ('Mavic 3 行业系列 (M3E 相机)', 1, 0, 77, 0, '-'),
+ ('Mavic 3 行业系列 (M3T 相机)', 1, 0, 77, 1, '-'),
+ ('Mavic 3 行业系列 (M3TA 相机)', 1, 0, 77, 3, '-');
+
+-- DJI Matrice 4 系列
+INSERT INTO device_air_type_general_enum (name, vendor_id, domain, type, sub_type, remark) VALUES
+ ('DJI Matrice 4 系列 (M4E 相机)', 1, 0, 99, 0, '-'),
+ ('DJI Matrice 4 系列 (M4T 相机)', 1, 0, 99, 1, '-');
+
+-- 遥控器系列
+INSERT INTO device_air_type_general_enum (name, vendor_id, domain, type, sub_type, remark) VALUES
+ ('DJI 带屏遥控器行业版', 1, 2, 56, 0, '搭配 Matrice 300 RTK'),
+ ('DJI RC Plus', 1, 2, 119, 0, '搭配 Matrice 350 RTK,Matrice 300 RTK,Matrice 30/30T'),
+ ('DJI RC Plus 2', 1, 2, 174, 0, '搭配 >DJI Matrice 4 系列'),
+ ('DJI RC Pro 行业版', 1, 2, 144, 0, '搭配 Mavic 3 行业系列');
+
+-- 大疆机场系列
+INSERT INTO device_air_type_general_enum (name, vendor_id, domain, type, sub_type, remark) VALUES
+ ('大疆机场', 1, 3, 1, 0, '-'),
+ ('大疆机场 2', 1, 3, 2, 0, '-'),
+ ('大疆机场 3', 1, 3, 3, 0, '-');
\ No newline at end of file
diff --git a/src/main/resources/db/migration/V6__Create_air_type_general_enum_table.sql b/src/main/resources/db/migration/V6__Create_air_type_general_enum_table.sql
deleted file mode 100644
index 8fcc438..0000000
--- a/src/main/resources/db/migration/V6__Create_air_type_general_enum_table.sql
+++ /dev/null
@@ -1,51 +0,0 @@
-CREATE TABLE IF NOT EXISTS `air_type_general_enum` (
- `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `name` VARCHAR(255) DEFAULT NULL COMMENT '名称',
- `domain` VARCHAR(255) DEFAULT NULL COMMENT '领域',
- `type` VARCHAR(255) DEFAULT NULL COMMENT '主类型',
- `sub_type` VARCHAR(255) DEFAULT NULL COMMENT '子类型',
- `icon` VARCHAR(255) DEFAULT NULL COMMENT '图标',
- `create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
- `create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
- `update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
- `update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
- `remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='无人机类型通用枚举表';
-
-
--- Matrice 系列
-INSERT INTO air_type_general_enum (name, domain, type, sub_type, remark) VALUES
- ('Matrice 400', '0', '103', '0', '-'),
- ('Matrice 350 RTK', '0', '89', '0', '-'),
- ('Matrice 300 RTK', '0', '60', '0', '-'),
- ('Matrice 30', '0', '67', '0', '-'),
- ('Matrice 30T', '0', '67', '1', '-'),
- ('Matrice 3D', '0', '91', '0', '-'),
- ('Matrice 3TD', '0', '91', '1', '-'),
- ('Matrice 4D', '0', '100', '0', '-'),
- ('Matrice 4TD', '0', '100', '1', '-');
-
--- Mavic 3 行业系列
-INSERT INTO air_type_general_enum (name, domain, type, sub_type, remark) VALUES
- ('Mavic 3 行业系列 (M3E 相机)', '0', '77', '0', '-'),
- ('Mavic 3 行业系列 (M3T 相机)', '0', '77', '1', '-'),
- ('Mavic 3 行业系列 (M3TA 相机)', '0', '77', '3', '-');
-
--- DJI Matrice 4 系列
-INSERT INTO air_type_general_enum (name, domain, type, sub_type, remark) VALUES
- ('DJI Matrice 4 系列 (M4E 相机)', '0', '99', '0', '-'),
- ('DJI Matrice 4 系列 (M4T 相机)', '0', '99', '1', '-');
-
--- 遥控器系列
-INSERT INTO air_type_general_enum (name, domain, type, sub_type, remark) VALUES
- ('DJI 带屏遥控器行业版', '2', '56', '0', '搭配 Matrice 300 RTK'),
- ('DJI RC Plus', '2', '119', '0', '搭配 Matrice 350 RTK,Matrice 300 RTK,Matrice 30/30T'),
- ('DJI RC Plus 2', '2', '174', '0', '搭配 >DJI Matrice 4 系列'),
- ('DJI RC Pro 行业版', '2', '144', '0', '搭配 Mavic 3 行业系列');
-
--- 大疆机场系列
-INSERT INTO air_type_general_enum (name, domain, type, sub_type, remark) VALUES
- ('大疆机场', '3', '1', '0', '-'),
- ('大疆机场 2', '3', '2', '0', '-'),
- ('大疆机场 3', '3', '3', '0', '-');
\ No newline at end of file
diff --git a/src/main/resources/mapper/device/AirTypeGeneralEnumMapper.xml b/src/main/resources/mapper/device/AirTypeGeneralEnumMapper.xml
index 2c54acf..92d3b84 100644
--- a/src/main/resources/mapper/device/AirTypeGeneralEnumMapper.xml
+++ b/src/main/resources/mapper/device/AirTypeGeneralEnumMapper.xml
@@ -7,9 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
-
+
@@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- select id, name, domain, type, sub_type, icon,
+ select id, name, vendor_id, domain, type, sub_type, icon,
create_by, create_time, update_by, update_time, remark
from air_type_general_enum
@@ -35,14 +36,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and name like concat('%', #{name}, '%')
-
+
+ and vendor_id = #{vendorId}
+
+
and domain = #{domain}
-
+
and type = #{type}
-
- and sub_type = #{sub_type}
+
+ and sub_type = #{subType}
@@ -51,9 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into air_type_general_enum
name,
- domain,
- type,
- sub_type,
+ vendor_id,
+ domain,
+ type,
+ sub_type,
icon,
create_by,
remark,
@@ -61,9 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{name},
- #{domain},
- #{type},
- #{sub_type},
+ #{vendorId},
+ #{domain},
+ #{type},
+ #{subType},
#{icon},
#{createBy},
#{remark},
@@ -75,9 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update air_type_general_enum
name = #{name},
- domain = #{domain},
- type = #{type},
- sub_type = #{sub_type},
+ vendor_id = #{vendorId},
+ domain = #{domain},
+ type = #{type},
+ sub_type = #{subType},
icon = #{icon},
update_by = #{updateBy},
remark = #{remark},