feat:增加无人机类型负载属性
This commit is contained in:
parent
8f86e92fcc
commit
17b6cadddd
|
|
@ -1,10 +1,15 @@
|
||||||
package com.ruoyi.device.controller.convert;
|
package com.ruoyi.device.controller.convert;
|
||||||
|
|
||||||
import com.ruoyi.common.core.utils.BaseConvert;
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
|
import com.ruoyi.device.api.domain.AirLoadTypeVO;
|
||||||
import com.ruoyi.device.api.domain.AirTypeGeneralEnumVO;
|
import com.ruoyi.device.api.domain.AirTypeGeneralEnumVO;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadTypeDTO;
|
||||||
import com.ruoyi.device.service.dto.DeviceAirTypeGeneralEnumDTO;
|
import com.ruoyi.device.service.dto.DeviceAirTypeGeneralEnumDTO;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机类型通用枚举Controller转换器
|
* 无人机类型通用枚举Controller转换器
|
||||||
|
|
@ -23,7 +28,27 @@ public class DeviceAirTypeGeneralEnumVOConvert extends BaseConvert<DeviceAirType
|
||||||
|
|
||||||
public static AirTypeGeneralEnumVO from(DeviceAirTypeGeneralEnumDTO dto)
|
public static AirTypeGeneralEnumVO from(DeviceAirTypeGeneralEnumDTO dto)
|
||||||
{
|
{
|
||||||
return INSTANCE.innerFrom(dto);
|
AirTypeGeneralEnumVO vo = INSTANCE.innerFrom(dto);
|
||||||
|
// 手动转换负载列表(按系列分组)
|
||||||
|
if (dto.getLoadList() != null) {
|
||||||
|
Map<String, List<AirLoadTypeVO>> loadVOMap = new HashMap<>();
|
||||||
|
for (Map.Entry<String, List<DeviceAirLoadTypeDTO>> entry : dto.getLoadList().entrySet()) {
|
||||||
|
String series = entry.getKey();
|
||||||
|
List<DeviceAirLoadTypeDTO> loadDTOList = entry.getValue();
|
||||||
|
List<AirLoadTypeVO> loadVOList = new ArrayList<>();
|
||||||
|
for (DeviceAirLoadTypeDTO loadDTO : loadDTOList) {
|
||||||
|
AirLoadTypeVO loadVO = new AirLoadTypeVO();
|
||||||
|
loadVO.setLoadName(loadDTO.getLoadName());
|
||||||
|
loadVO.setLoadSeries(loadDTO.getLoadSeries());
|
||||||
|
loadVO.setLoadCategory(loadDTO.getLoadCategory());
|
||||||
|
loadVO.setSlot(loadDTO.getSlot());
|
||||||
|
loadVOList.add(loadVO);
|
||||||
|
}
|
||||||
|
loadVOMap.put(series, loadVOList);
|
||||||
|
}
|
||||||
|
vo.setLoadList(loadVOMap);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DeviceAirTypeGeneralEnumDTO to(AirTypeGeneralEnumVO vo)
|
public static DeviceAirTypeGeneralEnumDTO to(AirTypeGeneralEnumVO vo)
|
||||||
|
|
@ -33,7 +58,11 @@ public class DeviceAirTypeGeneralEnumVOConvert extends BaseConvert<DeviceAirType
|
||||||
|
|
||||||
public static List<AirTypeGeneralEnumVO> fromList(List<DeviceAirTypeGeneralEnumDTO> dtoList)
|
public static List<AirTypeGeneralEnumVO> fromList(List<DeviceAirTypeGeneralEnumDTO> dtoList)
|
||||||
{
|
{
|
||||||
return INSTANCE.innerFromList(dtoList);
|
List<AirTypeGeneralEnumVO> voList = new ArrayList<>();
|
||||||
|
for (DeviceAirTypeGeneralEnumDTO dto : dtoList) {
|
||||||
|
voList.add(from(dto));
|
||||||
|
}
|
||||||
|
return voList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<DeviceAirTypeGeneralEnumDTO> toList(List<AirTypeGeneralEnumVO> voList)
|
public static List<DeviceAirTypeGeneralEnumDTO> toList(List<AirTypeGeneralEnumVO> voList)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.ruoyi.device.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位实体
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadSlot extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 槽位数 */
|
||||||
|
private Integer slotCount;
|
||||||
|
|
||||||
|
/** 负载数量限制 */
|
||||||
|
private Integer loadLimit;
|
||||||
|
|
||||||
|
/** 配件限制数量 */
|
||||||
|
private Integer accessoryLimit;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.ruoyi.device.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型实体
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadType extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 负载名称 */
|
||||||
|
private String loadName;
|
||||||
|
|
||||||
|
/** 负载系列 */
|
||||||
|
private String loadSeries;
|
||||||
|
|
||||||
|
/** 负载分类:0-负载,1-配件 */
|
||||||
|
private Integer loadCategory;
|
||||||
|
|
||||||
|
/** 槽:1、2 或者-1(-1代表全部槽位可用) */
|
||||||
|
private Integer slot;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ruoyi.device.domain.api;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位领域接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface IDeviceAirLoadSlotDomain {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据厂商ID、主类型、子类型查询负载槽位
|
||||||
|
*
|
||||||
|
* @return 负载槽位信息
|
||||||
|
*/
|
||||||
|
DeviceAirLoadSlot selectDeviceAirLoadSlotByVendorAndType(DeviceAirLoadSlot deviceAirLoadSlot);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ruoyi.device.domain.api;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型领域接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface IDeviceAirLoadTypeDomain {
|
||||||
|
/**
|
||||||
|
* 查询无人机负载类型列表
|
||||||
|
*
|
||||||
|
* @param deviceAirLoadType 无人机负载类型
|
||||||
|
* @return 无人机负载类型集合
|
||||||
|
*/
|
||||||
|
List<DeviceAirLoadType> selectDeviceAirLoadTypeList(DeviceAirLoadType deviceAirLoadType);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.ruoyi.device.domain.convert;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadSlotEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位领域层转换器
|
||||||
|
* Domain Entity ↔ Mapper Entity
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public class DeviceAirLoadSlotConvert extends BaseConvert<DeviceAirLoadSlotEntity, DeviceAirLoadSlot>
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final DeviceAirLoadSlotConvert INSTANCE = new DeviceAirLoadSlotConvert();
|
||||||
|
|
||||||
|
private DeviceAirLoadSlotConvert() {
|
||||||
|
super(DeviceAirLoadSlotEntity.class, DeviceAirLoadSlot.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity 转 Domain
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadSlot from(DeviceAirLoadSlotEntity entity)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFrom(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain 转 Entity
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadSlotEntity to(DeviceAirLoadSlot domain)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerTo(domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity List 转 Domain List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadSlot> fromList(List<DeviceAirLoadSlotEntity> entityList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFromList(entityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain List 转 Entity List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadSlotEntity> toList(List<DeviceAirLoadSlot> domainList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerToList(domainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.ruoyi.device.domain.convert;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型领域层转换器
|
||||||
|
* Domain Entity ↔ Mapper Entity
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public class DeviceAirLoadTypeConvert extends BaseConvert<DeviceAirLoadTypeEntity, DeviceAirLoadType>
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final DeviceAirLoadTypeConvert INSTANCE = new DeviceAirLoadTypeConvert();
|
||||||
|
|
||||||
|
private DeviceAirLoadTypeConvert() {
|
||||||
|
super(DeviceAirLoadTypeEntity.class, DeviceAirLoadType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity 转 Domain
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadType from(DeviceAirLoadTypeEntity entity)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFrom(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain 转 Entity
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadTypeEntity to(DeviceAirLoadType domain)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerTo(domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity List 转 Domain List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadType> fromList(List<DeviceAirLoadTypeEntity> entityList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFromList(entityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain List 转 Entity List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadTypeEntity> toList(List<DeviceAirLoadType> domainList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerToList(domainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.ruoyi.device.domain.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.domain.api.IDeviceAirLoadSlotDomain;
|
||||||
|
import com.ruoyi.device.domain.convert.DeviceAirLoadSlotConvert;
|
||||||
|
import com.ruoyi.device.domain.convert.DeviceAirLoadTypeConvert;
|
||||||
|
import com.ruoyi.device.mapper.DeviceAirLoadSlotMapper;
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadSlotEntity;
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadSlotDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位Domain实现类
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class DeviceAirLoadSlotDomainImpl implements IDeviceAirLoadSlotDomain {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeviceAirLoadSlotMapper deviceAirLoadSlotMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceAirLoadSlot selectDeviceAirLoadSlotByVendorAndType(DeviceAirLoadSlot deviceAirLoadSlot) {
|
||||||
|
DeviceAirLoadSlotEntity entity = DeviceAirLoadSlotConvert.to(deviceAirLoadSlot);
|
||||||
|
DeviceAirLoadSlotEntity result = deviceAirLoadSlotMapper.selectDeviceAirLoadSlotByVendorAndType(entity);
|
||||||
|
if (result == null) {
|
||||||
|
// 设置默认值
|
||||||
|
result = new DeviceAirLoadSlotEntity();
|
||||||
|
result.setSlotCount(0);
|
||||||
|
result.setLoadLimit(0);
|
||||||
|
result.setAccessoryLimit(0);
|
||||||
|
}
|
||||||
|
return DeviceAirLoadSlotConvert.from(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.ruoyi.device.domain.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import com.ruoyi.device.domain.api.IDeviceAirLoadTypeDomain;
|
||||||
|
import com.ruoyi.device.domain.convert.DeviceAirLoadTypeConvert;
|
||||||
|
import com.ruoyi.device.mapper.DeviceAirLoadTypeMapper;
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型Domain实现类
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class DeviceAirLoadTypeDomainImpl implements IDeviceAirLoadTypeDomain {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeviceAirLoadTypeMapper deviceAirLoadTypeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceAirLoadType> selectDeviceAirLoadTypeList(DeviceAirLoadType deviceAirLoadType) {
|
||||||
|
DeviceAirLoadTypeEntity entity = DeviceAirLoadTypeConvert.to(deviceAirLoadType);
|
||||||
|
List<DeviceAirLoadTypeEntity> entityList = deviceAirLoadTypeMapper.selectDeviceAirLoadTypeList(entity);
|
||||||
|
return DeviceAirLoadTypeConvert.fromList(entityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadSlotEntity;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位Mapper接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface DeviceAirLoadSlotMapper {
|
||||||
|
/**
|
||||||
|
* 根据厂商ID、主类型、子类型查询负载槽位
|
||||||
|
*
|
||||||
|
* @return 负载槽位信息
|
||||||
|
*/
|
||||||
|
DeviceAirLoadSlotEntity selectDeviceAirLoadSlotByVendorAndType(DeviceAirLoadSlotEntity entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型Mapper接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface DeviceAirLoadTypeMapper {
|
||||||
|
/**
|
||||||
|
* 查询无人机负载类型列表
|
||||||
|
*
|
||||||
|
* @param deviceAirLoadType 无人机负载类型
|
||||||
|
* @return 无人机负载类型集合
|
||||||
|
*/
|
||||||
|
List<DeviceAirLoadTypeEntity> selectDeviceAirLoadTypeList(DeviceAirLoadTypeEntity deviceAirLoadType);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.ruoyi.device.mapper.entity;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位表实体对象 device_air_load_slot
|
||||||
|
* Mapper 层实体,对应数据库表
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadSlotEntity extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 槽位数 */
|
||||||
|
private Integer slotCount;
|
||||||
|
|
||||||
|
/** 负载数量限制 */
|
||||||
|
private Integer loadLimit;
|
||||||
|
|
||||||
|
/** 配件限制数量 */
|
||||||
|
private Integer accessoryLimit;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "DeviceAirLoadSlotEntity{" +
|
||||||
|
"id=" + id +
|
||||||
|
", vendorId=" + vendorId +
|
||||||
|
", type=" + type +
|
||||||
|
", subType=" + subType +
|
||||||
|
", slotCount=" + slotCount +
|
||||||
|
", loadLimit=" + loadLimit +
|
||||||
|
", accessoryLimit=" + accessoryLimit +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.ruoyi.device.mapper.entity;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型表实体对象 device_air_load_type
|
||||||
|
* Mapper 层实体,对应数据库表
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadTypeEntity extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 负载名称 */
|
||||||
|
private String loadName;
|
||||||
|
|
||||||
|
/** 负载系列 */
|
||||||
|
private String loadSeries;
|
||||||
|
|
||||||
|
/** 负载分类:0-负载,1-配件 */
|
||||||
|
private Integer loadCategory;
|
||||||
|
|
||||||
|
/** 槽:1、2 或者-1(-1代表全部槽位可用) */
|
||||||
|
private Integer slot;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "DeviceAirLoadTypeEntity{" +
|
||||||
|
"id=" + id +
|
||||||
|
", vendorId=" + vendorId +
|
||||||
|
", type=" + type +
|
||||||
|
", subType=" + subType +
|
||||||
|
", loadName='" + loadName + '\'' +
|
||||||
|
", loadSeries='" + loadSeries + '\'' +
|
||||||
|
", loadCategory=" + loadCategory +
|
||||||
|
", slot=" + slot +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ruoyi.device.service.api;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadSlotDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位Service接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface IDeviceAirLoadSlotService {
|
||||||
|
/**
|
||||||
|
* 根据厂商ID、主类型、子类型查询负载槽位
|
||||||
|
*
|
||||||
|
* @param vendorId 厂商ID
|
||||||
|
* @param type 主类型
|
||||||
|
* @param subType 子类型
|
||||||
|
* @return 负载槽位信息
|
||||||
|
*/
|
||||||
|
DeviceAirLoadSlotDTO selectDeviceAirLoadSlotByVendorAndType(DeviceAirLoadSlotDTO deviceAirLoadSlotDTO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ruoyi.device.service.api;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadTypeDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型Service接口
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface IDeviceAirLoadTypeService {
|
||||||
|
/**
|
||||||
|
* 查询无人机负载类型列表
|
||||||
|
*
|
||||||
|
* @param deviceAirLoadTypeDTO 无人机负载类型
|
||||||
|
* @return 无人机负载类型集合
|
||||||
|
*/
|
||||||
|
List<DeviceAirLoadTypeDTO> selectDeviceAirLoadTypeList(DeviceAirLoadTypeDTO deviceAirLoadTypeDTO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.ruoyi.device.service.convert;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadSlotDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位Service层转换器
|
||||||
|
* Service DTO ↔ Domain Entity
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public class DeviceAirLoadSlotDTOConvert extends BaseConvert<DeviceAirLoadSlot, DeviceAirLoadSlotDTO>
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final DeviceAirLoadSlotDTOConvert INSTANCE = new DeviceAirLoadSlotDTOConvert();
|
||||||
|
|
||||||
|
private DeviceAirLoadSlotDTOConvert() {
|
||||||
|
super(DeviceAirLoadSlot.class, DeviceAirLoadSlotDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity 转 DTO
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadSlotDTO from(DeviceAirLoadSlot entity)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFrom(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO 转 Entity
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadSlot to(DeviceAirLoadSlotDTO dto)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerTo(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity List 转 DTO List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadSlotDTO> fromList(List<DeviceAirLoadSlot> entityList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFromList(entityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO List 转 Entity List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadSlot> toList(List<DeviceAirLoadSlotDTO> dtoList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerToList(dtoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.ruoyi.device.service.convert;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadTypeDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型Service层转换器
|
||||||
|
* Service DTO ↔ Domain Entity
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
public class DeviceAirLoadTypeDTOConvert extends BaseConvert<DeviceAirLoadType, DeviceAirLoadTypeDTO>
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final DeviceAirLoadTypeDTOConvert INSTANCE = new DeviceAirLoadTypeDTOConvert();
|
||||||
|
|
||||||
|
private DeviceAirLoadTypeDTOConvert() {
|
||||||
|
super(DeviceAirLoadType.class, DeviceAirLoadTypeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity 转 DTO
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadTypeDTO from(DeviceAirLoadType entity)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFrom(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO 转 Entity
|
||||||
|
*/
|
||||||
|
public static DeviceAirLoadType to(DeviceAirLoadTypeDTO dto)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerTo(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity List 转 DTO List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadTypeDTO> fromList(List<DeviceAirLoadType> entityList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerFromList(entityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DTO List 转 Entity List
|
||||||
|
*/
|
||||||
|
public static List<DeviceAirLoadType> toList(List<DeviceAirLoadTypeDTO> dtoList)
|
||||||
|
{
|
||||||
|
return INSTANCE.innerToList(dtoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.ruoyi.device.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位DTO
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadSlotDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 槽位数 */
|
||||||
|
private Integer slotCount;
|
||||||
|
|
||||||
|
/** 负载数量限制 */
|
||||||
|
private Integer loadLimit;
|
||||||
|
|
||||||
|
/** 配件限制数量 */
|
||||||
|
private Integer accessoryLimit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.device.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型DTO
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeviceAirLoadTypeDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 无人机厂商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 无人机主类型 */
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 无人机子类型 */
|
||||||
|
private Long subType;
|
||||||
|
|
||||||
|
/** 负载名称 */
|
||||||
|
private String loadName;
|
||||||
|
|
||||||
|
/** 负载系列 */
|
||||||
|
private String loadSeries;
|
||||||
|
|
||||||
|
/** 负载分类:0-负载,1-配件 */
|
||||||
|
private Integer loadCategory;
|
||||||
|
|
||||||
|
/** 槽:1、2 或者-1(-1代表全部槽位可用) */
|
||||||
|
private Integer slot;
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,8 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机类型通用枚举服务层DTO
|
* 无人机类型通用枚举服务层DTO
|
||||||
|
|
@ -47,4 +48,16 @@ public class DeviceAirTypeGeneralEnumDTO extends BaseEntity
|
||||||
/** 是否生效:0-失效,1-生效 */
|
/** 是否生效:0-失效,1-生效 */
|
||||||
private Integer enabled;
|
private Integer enabled;
|
||||||
|
|
||||||
|
/** 槽位数 */
|
||||||
|
private Integer slotCount;
|
||||||
|
|
||||||
|
/** 负载数量限制 */
|
||||||
|
private Integer loadLimit;
|
||||||
|
|
||||||
|
/** 配件限制数量 */
|
||||||
|
private Integer accessoryLimit;
|
||||||
|
|
||||||
|
/** 可用负载列表(按系列分组) */
|
||||||
|
private Map<String, List<DeviceAirLoadTypeDTO>> loadList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.domain.api.IDeviceAirLoadSlotDomain;
|
||||||
|
import com.ruoyi.device.service.api.IDeviceAirLoadSlotService;
|
||||||
|
import com.ruoyi.device.service.convert.DeviceAirLoadSlotDTOConvert;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadSlotDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载槽位Service实现
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceAirLoadSlotServiceImpl implements IDeviceAirLoadSlotService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceAirLoadSlotDomain deviceAirLoadSlotDomain;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceAirLoadSlotDTO selectDeviceAirLoadSlotByVendorAndType(DeviceAirLoadSlotDTO deviceAirLoadSlotDTO) {
|
||||||
|
|
||||||
|
DeviceAirLoadSlot entity = DeviceAirLoadSlotDTOConvert.to(deviceAirLoadSlotDTO);
|
||||||
|
DeviceAirLoadSlot slotInfo = deviceAirLoadSlotDomain.selectDeviceAirLoadSlotByVendorAndType(entity);
|
||||||
|
|
||||||
|
return DeviceAirLoadSlotDTOConvert.from(slotInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
|
import com.ruoyi.device.domain.api.IDeviceAirLoadTypeDomain;
|
||||||
|
import com.ruoyi.device.service.api.IDeviceAirLoadTypeService;
|
||||||
|
import com.ruoyi.device.service.convert.DeviceAirLoadTypeDTOConvert;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadTypeDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无人机负载类型Service实现
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-03-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceAirLoadTypeServiceImpl implements IDeviceAirLoadTypeService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceAirLoadTypeDomain deviceAirLoadTypeDomain;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceAirLoadTypeDTO> selectDeviceAirLoadTypeList(DeviceAirLoadTypeDTO deviceAirLoadType) {
|
||||||
|
|
||||||
|
DeviceAirLoadType entity = DeviceAirLoadTypeDTOConvert.to(deviceAirLoadType);
|
||||||
|
List<DeviceAirLoadType> loadTypes = deviceAirLoadTypeDomain.selectDeviceAirLoadTypeList(entity);
|
||||||
|
|
||||||
|
return DeviceAirLoadTypeDTOConvert.fromList(loadTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,17 +1,28 @@
|
||||||
package com.ruoyi.device.service.impl;
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadSlot;
|
||||||
|
import com.ruoyi.device.domain.DeviceAirLoadType;
|
||||||
import com.ruoyi.device.domain.api.IDeviceAirTypeGeneralEnumDomain;
|
import com.ruoyi.device.domain.api.IDeviceAirTypeGeneralEnumDomain;
|
||||||
|
import com.ruoyi.device.domain.convert.DeviceAirTypeGeneralEnumConvert;
|
||||||
import com.ruoyi.device.domain.model.DeviceAirTypeGeneralEnum;
|
import com.ruoyi.device.domain.model.DeviceAirTypeGeneralEnum;
|
||||||
|
import com.ruoyi.device.service.api.IDeviceAirLoadSlotService;
|
||||||
|
import com.ruoyi.device.service.api.IDeviceAirLoadTypeService;
|
||||||
import com.ruoyi.device.service.api.IDeviceAirTypeGeneralEnumService;
|
import com.ruoyi.device.service.api.IDeviceAirTypeGeneralEnumService;
|
||||||
|
import com.ruoyi.device.service.convert.DeviceAirLoadTypeDTOConvert;
|
||||||
import com.ruoyi.device.service.convert.DeviceAirTypeGeneralEnumDTOConvert;
|
import com.ruoyi.device.service.convert.DeviceAirTypeGeneralEnumDTOConvert;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadSlotDTO;
|
||||||
|
import com.ruoyi.device.service.dto.DeviceAirLoadTypeDTO;
|
||||||
import com.ruoyi.device.service.dto.DeviceAirTypeGeneralEnumDTO;
|
import com.ruoyi.device.service.dto.DeviceAirTypeGeneralEnumDTO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机类型通用枚举Service业务层处理
|
* 无人机类型通用枚举Service实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2026-01-28
|
* @date 2026-01-28
|
||||||
|
|
@ -22,17 +33,55 @@ public class DeviceAirTypeGeneralEnumServiceImpl implements IDeviceAirTypeGenera
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceAirTypeGeneralEnumDomain airTypeGeneralEnumDomain;
|
private IDeviceAirTypeGeneralEnumDomain airTypeGeneralEnumDomain;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceAirLoadSlotService deviceAirLoadSlotService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceAirLoadTypeService deviceAirLoadTypeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceAirTypeGeneralEnumDTO> selectAirTypeGeneralEnumList(DeviceAirTypeGeneralEnumDTO airTypeGeneralEnumDTO)
|
public List<DeviceAirTypeGeneralEnumDTO> selectAirTypeGeneralEnumList(DeviceAirTypeGeneralEnumDTO airTypeGeneralEnumDTO) {
|
||||||
{
|
// 转换DTO为领域模型
|
||||||
DeviceAirTypeGeneralEnum model = DeviceAirTypeGeneralEnumDTOConvert.to(airTypeGeneralEnumDTO);
|
DeviceAirTypeGeneralEnum model = DeviceAirTypeGeneralEnumDTOConvert.to(airTypeGeneralEnumDTO);
|
||||||
|
// 通过领域层获取数据
|
||||||
List<DeviceAirTypeGeneralEnum> modelList = airTypeGeneralEnumDomain.selectAirTypeGeneralEnumList(model);
|
List<DeviceAirTypeGeneralEnum> modelList = airTypeGeneralEnumDomain.selectAirTypeGeneralEnumList(model);
|
||||||
return DeviceAirTypeGeneralEnumDTOConvert.fromList(modelList);
|
// 转换领域模型为DTO
|
||||||
|
List<DeviceAirTypeGeneralEnumDTO> list = DeviceAirTypeGeneralEnumDTOConvert.fromList(modelList);
|
||||||
|
|
||||||
|
// 关联负载信息
|
||||||
|
for (DeviceAirTypeGeneralEnumDTO dto : list) {
|
||||||
|
// 关联负载槽位信息
|
||||||
|
DeviceAirLoadSlotDTO deviceAirLoadSlotDTO = new DeviceAirLoadSlotDTO();
|
||||||
|
deviceAirLoadSlotDTO.setVendorId(dto.getVendorId());
|
||||||
|
deviceAirLoadSlotDTO.setType(dto.getType());
|
||||||
|
deviceAirLoadSlotDTO.setSubType(dto.getSubType());
|
||||||
|
DeviceAirLoadSlotDTO slotInfo = deviceAirLoadSlotService.selectDeviceAirLoadSlotByVendorAndType(deviceAirLoadSlotDTO);
|
||||||
|
dto.setSlotCount(slotInfo.getSlotCount());
|
||||||
|
dto.setLoadLimit(slotInfo.getLoadLimit());
|
||||||
|
dto.setAccessoryLimit(slotInfo.getAccessoryLimit());
|
||||||
|
|
||||||
|
// 关联负载类型信息(按系列分组)
|
||||||
|
DeviceAirLoadTypeDTO deviceAirLoadTypeDTO = new DeviceAirLoadTypeDTO();
|
||||||
|
deviceAirLoadTypeDTO.setVendorId(dto.getVendorId());
|
||||||
|
deviceAirLoadTypeDTO.setType(dto.getType());
|
||||||
|
deviceAirLoadTypeDTO.setSubType(dto.getSubType());
|
||||||
|
List<DeviceAirLoadTypeDTO> deviceAirLoadTypeDTOS = deviceAirLoadTypeService.selectDeviceAirLoadTypeList(deviceAirLoadTypeDTO);
|
||||||
|
|
||||||
|
Map<String, List<DeviceAirLoadTypeDTO>> loadMap = new HashMap<>();
|
||||||
|
for (DeviceAirLoadTypeDTO airLoadTypeDTO : deviceAirLoadTypeDTOS) {
|
||||||
|
if (loadMap.get(airLoadTypeDTO.getLoadSeries()).isEmpty()) {
|
||||||
|
loadMap.put(airLoadTypeDTO.getLoadSeries(), new ArrayList<>());
|
||||||
|
}
|
||||||
|
loadMap.get(airLoadTypeDTO.getLoadSeries()).add(airLoadTypeDTO);
|
||||||
|
}
|
||||||
|
dto.setLoadList(loadMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeviceAirTypeGeneralEnumDTO selectAirTypeGeneralEnumById(Long id)
|
public DeviceAirTypeGeneralEnumDTO selectAirTypeGeneralEnumById(Long id) {
|
||||||
{
|
|
||||||
DeviceAirTypeGeneralEnum model = airTypeGeneralEnumDomain.selectAirTypeGeneralEnumById(id);
|
DeviceAirTypeGeneralEnum model = airTypeGeneralEnumDomain.selectAirTypeGeneralEnumById(id);
|
||||||
return DeviceAirTypeGeneralEnumDTOConvert.from(model);
|
return DeviceAirTypeGeneralEnumDTOConvert.from(model);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,38 @@ INSERT INTO device_air_type_general_enum (name, category, enabled, vendor_id, do
|
||||||
-- 拓恒无人机系列
|
-- 拓恒无人机系列
|
||||||
INSERT INTO device_air_type_general_enum (name, category, enabled, vendor_id, domain, type, sub_type, remark) VALUES
|
INSERT INTO device_air_type_general_enum (name, category, enabled, vendor_id, domain, type, sub_type, remark) VALUES
|
||||||
('云003-FM', '云', 1, 0, 0, 1, 0, '-');
|
('云003-FM', '云', 1, 0, 0, 1, 0, '-');
|
||||||
|
|
||||||
|
-- 创建无人机负载类型表
|
||||||
|
CREATE TABLE IF NOT EXISTS `device_air_load_type` (
|
||||||
|
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`vendor_id` BIGINT DEFAULT NULL COMMENT '无人机厂商ID',
|
||||||
|
`type` BIGINT DEFAULT NULL COMMENT '无人机主类型',
|
||||||
|
`sub_type` BIGINT DEFAULT NULL COMMENT '无人机子类型',
|
||||||
|
`load_name` VARCHAR(255) DEFAULT NULL COMMENT '负载名称',
|
||||||
|
`load_series` VARCHAR(255) DEFAULT NULL COMMENT '负载系列',
|
||||||
|
`load_category` TINYINT DEFAULT 0 COMMENT '负载分类:0-负载,1-配件',
|
||||||
|
`slot` INT DEFAULT -1 COMMENT '槽:1、2 或者-1(-1代表全部槽位可用)',
|
||||||
|
`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='无人机负载类型表';
|
||||||
|
|
||||||
|
-- 创建无人机负载槽位表
|
||||||
|
CREATE TABLE IF NOT EXISTS `device_air_load_slot` (
|
||||||
|
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`vendor_id` BIGINT DEFAULT NULL COMMENT '无人机厂商ID',
|
||||||
|
`type` BIGINT DEFAULT NULL COMMENT '无人机主类型',
|
||||||
|
`sub_type` BIGINT DEFAULT NULL COMMENT '无人机子类型',
|
||||||
|
`slot_count` INT DEFAULT 4 COMMENT '槽位数',
|
||||||
|
`load_limit` INT DEFAULT 1 COMMENT '负载数量限制',
|
||||||
|
`accessory_limit` INT DEFAULT 2 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='无人机负载槽位表';
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.device.mapper.DeviceAirLoadSlotMapper">
|
||||||
|
<resultMap type="com.ruoyi.device.mapper.entity.DeviceAirLoadSlotEntity" id="DeviceAirLoadSlotResult">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="vendorId" column="vendor_id"/>
|
||||||
|
<result property="type" column="type"/>
|
||||||
|
<result property="subType" column="sub_type"/>
|
||||||
|
<result property="slotCount" column="slot_count"/>
|
||||||
|
<result property="loadLimit" column="load_limit"/>
|
||||||
|
<result property="accessoryLimit" column="accessory_limit"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectDeviceAirLoadSlotByVendorAndType" parameterType="com.ruoyi.device.mapper.entity.DeviceAirLoadSlotEntity" resultMap="DeviceAirLoadSlotResult">
|
||||||
|
select id, vendor_id, type, sub_type, slot_count, load_limit, accessory_limit, create_by, create_time, update_by, update_time, remark
|
||||||
|
from device_air_load_slot
|
||||||
|
where vendor_id = #{vendorId} and type = #{type} and sub_type = #{subType}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.device.mapper.DeviceAirLoadTypeMapper">
|
||||||
|
<resultMap type="com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity" id="DeviceAirLoadTypeResult">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="vendorId" column="vendor_id"/>
|
||||||
|
<result property="type" column="type"/>
|
||||||
|
<result property="subType" column="sub_type"/>
|
||||||
|
<result property="loadName" column="load_name"/>
|
||||||
|
<result property="loadSeries" column="load_series"/>
|
||||||
|
<result property="loadCategory" column="load_category"/>
|
||||||
|
<result property="slot" column="slot"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectDeviceAirLoadTypeList" parameterType="com.ruoyi.device.mapper.entity.DeviceAirLoadTypeEntity" resultMap="DeviceAirLoadTypeResult">
|
||||||
|
select id, vendor_id, type, sub_type, load_name, load_series, load_category, slot, create_by, create_time, update_by, update_time, remark
|
||||||
|
from device_air_load_type
|
||||||
|
<where>
|
||||||
|
<if test="vendorId != null">
|
||||||
|
and vendor_id = #{vendorId}
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
and type = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="subType != null">
|
||||||
|
and sub_type = #{subType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue