Compare commits
5 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
cec154a8b2 | |
|
|
b6777f4776 | |
|
|
3b89fd90dd | |
|
|
ca475c5fb1 | |
|
|
3fcf45a6fb |
|
|
@ -45,7 +45,11 @@ public class AirlineMarkerController extends BaseController {
|
||||||
marker.setCreateBy(SecurityUtils.getUserId().toString());
|
marker.setCreateBy(SecurityUtils.getUserId().toString());
|
||||||
marker.setUpdateBy(SecurityUtils.getUserId().toString());
|
marker.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||||
AirlineMarkerDTO dto = AirlineMarkerControllerConvert.to(marker);
|
AirlineMarkerDTO dto = AirlineMarkerControllerConvert.to(marker);
|
||||||
return toAjax(iAirlineMarkerGroupInfoService.insertMarker(dto));
|
AirlineMarkerDTO result = iAirlineMarkerGroupInfoService.insertMarker(dto);
|
||||||
|
if (result != null) {
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
return error("新增标注失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
package com.ruoyi.airline.controller.convert;
|
package com.ruoyi.airline.controller.convert;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.ruoyi.airline.api.domain.AirlineMarkerVO;
|
import com.ruoyi.airline.api.domain.AirlineMarkerVO;
|
||||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||||
import com.ruoyi.common.core.utils.BaseConvert;
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标注Controller转换类
|
* 标注Controller转换类
|
||||||
|
|
@ -17,8 +16,7 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO, AirlineMarkerVO>
|
public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO, AirlineMarkerVO>
|
||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(AirlineMarkerControllerConvert.class);
|
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
private static final AirlineMarkerControllerConvert INSTANCE = new AirlineMarkerControllerConvert();
|
private static final AirlineMarkerControllerConvert INSTANCE = new AirlineMarkerControllerConvert();
|
||||||
|
|
||||||
private AirlineMarkerControllerConvert() {
|
private AirlineMarkerControllerConvert() {
|
||||||
|
|
@ -54,20 +52,7 @@ public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO
|
||||||
vo.setColor(dto.getColor());
|
vo.setColor(dto.getColor());
|
||||||
vo.setIcon(dto.getIcon());
|
vo.setIcon(dto.getIcon());
|
||||||
vo.setFontSize(dto.getFontSize());
|
vo.setFontSize(dto.getFontSize());
|
||||||
|
vo.setCoordinates(dto.getCoordinates());
|
||||||
// 转换coordinates
|
|
||||||
if (dto.getCoordinates() != null) {
|
|
||||||
vo.setCoordinates(dto.getCoordinates().stream()
|
|
||||||
.map(point -> {
|
|
||||||
AirlineMarkerVO.PointInfo voPoint = new AirlineMarkerVO.PointInfo();
|
|
||||||
voPoint.setLatitude(point.getLatitude());
|
|
||||||
voPoint.setLongitude(point.getLongitude());
|
|
||||||
voPoint.setAsl(point.getAsl());
|
|
||||||
return voPoint;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
|
|
||||||
vo.setDescription(dto.getDescription());
|
vo.setDescription(dto.getDescription());
|
||||||
vo.setGroupId(dto.getGroupId());
|
vo.setGroupId(dto.getGroupId());
|
||||||
vo.setCreateBy(dto.getCreateBy());
|
vo.setCreateBy(dto.getCreateBy());
|
||||||
|
|
@ -90,20 +75,15 @@ public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO
|
||||||
dto.setColor(vo.getColor());
|
dto.setColor(vo.getColor());
|
||||||
dto.setIcon(vo.getIcon());
|
dto.setIcon(vo.getIcon());
|
||||||
dto.setFontSize(vo.getFontSize());
|
dto.setFontSize(vo.getFontSize());
|
||||||
|
|
||||||
// 转换coordinates
|
|
||||||
if (vo.getCoordinates() != null) {
|
if (vo.getCoordinates() != null) {
|
||||||
dto.setCoordinates(vo.getCoordinates().stream()
|
try {
|
||||||
.map(point -> {
|
dto.setCoordinates(objectMapper.writeValueAsString(vo.getCoordinates()));
|
||||||
AirlineMarkerDTO.PointInfo dtoPoint = new AirlineMarkerDTO.PointInfo();
|
} catch (JsonProcessingException e) {
|
||||||
dtoPoint.setLatitude(point.getLatitude());
|
dto.setCoordinates(null);
|
||||||
dtoPoint.setLongitude(point.getLongitude());
|
}
|
||||||
dtoPoint.setAsl(point.getAsl());
|
|
||||||
return dtoPoint;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.setDescription(vo.getDescription());
|
dto.setDescription(vo.getDescription());
|
||||||
dto.setGroupId(vo.getGroupId());
|
dto.setGroupId(vo.getGroupId());
|
||||||
dto.setCreateBy(vo.getCreateBy());
|
dto.setCreateBy(vo.getCreateBy());
|
||||||
|
|
@ -112,4 +92,4 @@ public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO
|
||||||
dto.setUpdateTime(vo.getUpdateTime());
|
dto.setUpdateTime(vo.getUpdateTime());
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package com.ruoyi.airline.domain.convert;
|
package com.ruoyi.airline.domain.convert;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.ruoyi.common.core.utils.BaseConvert;
|
import com.ruoyi.common.core.utils.BaseConvert;
|
||||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerEntity;
|
import com.ruoyi.airline.mapper.entity.AirlineMarkerEntity;
|
||||||
|
|
@ -17,7 +15,6 @@ import java.util.List;
|
||||||
public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity, AirlineMarker>
|
public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity, AirlineMarker>
|
||||||
{
|
{
|
||||||
private static final AirlineMarkerDomainConvert INSTANCE = new AirlineMarkerDomainConvert();
|
private static final AirlineMarkerDomainConvert INSTANCE = new AirlineMarkerDomainConvert();
|
||||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
|
|
||||||
private AirlineMarkerDomainConvert() {
|
private AirlineMarkerDomainConvert() {
|
||||||
super(AirlineMarkerEntity.class, AirlineMarker.class);
|
super(AirlineMarkerEntity.class, AirlineMarker.class);
|
||||||
|
|
@ -52,16 +49,7 @@ public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity,
|
||||||
model.setColor(entity.getColor());
|
model.setColor(entity.getColor());
|
||||||
model.setIcon(entity.getIcon());
|
model.setIcon(entity.getIcon());
|
||||||
model.setFontSize(entity.getFontSize());
|
model.setFontSize(entity.getFontSize());
|
||||||
|
model.setCoordinates(entity.getCoordinates());
|
||||||
// 从JSON字符串转换为List<PointInfo>
|
|
||||||
if (entity.getCoordinates() != null) {
|
|
||||||
try {
|
|
||||||
model.setCoordinates(objectMapper.readValue(entity.getCoordinates(), objectMapper.getTypeFactory().constructCollectionType(List.class, AirlineMarker.PointInfo.class)));
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
model.setDescription(entity.getDescription());
|
model.setDescription(entity.getDescription());
|
||||||
model.setCreateBy(entity.getCreateBy());
|
model.setCreateBy(entity.getCreateBy());
|
||||||
model.setCreateTime(entity.getCreateTime());
|
model.setCreateTime(entity.getCreateTime());
|
||||||
|
|
@ -84,16 +72,7 @@ public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity,
|
||||||
entity.setColor(model.getColor());
|
entity.setColor(model.getColor());
|
||||||
entity.setIcon(model.getIcon());
|
entity.setIcon(model.getIcon());
|
||||||
entity.setFontSize(model.getFontSize());
|
entity.setFontSize(model.getFontSize());
|
||||||
|
entity.setCoordinates(model.getCoordinates());
|
||||||
// 从List<PointInfo>转换为JSON字符串
|
|
||||||
if (model.getCoordinates() != null) {
|
|
||||||
try {
|
|
||||||
entity.setCoordinates(objectMapper.writeValueAsString(model.getCoordinates()));
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.setDescription(model.getDescription());
|
entity.setDescription(model.getDescription());
|
||||||
entity.setCreateBy(model.getCreateBy());
|
entity.setCreateBy(model.getCreateBy());
|
||||||
entity.setCreateTime(model.getCreateTime());
|
entity.setCreateTime(model.getCreateTime());
|
||||||
|
|
@ -102,4 +81,4 @@ public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity,
|
||||||
entity.setRemark(model.getRemark());
|
entity.setRemark(model.getRemark());
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,8 +6,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标注
|
* 标注
|
||||||
*
|
*
|
||||||
|
|
@ -52,9 +50,9 @@ public class AirlineMarker extends ExBaseEntity {
|
||||||
private Integer fontSize;
|
private Integer fontSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经纬度,格式:[经,纬,asl高度]
|
* 坐标JSON字符串
|
||||||
*/
|
*/
|
||||||
private List<PointInfo> coordinates;
|
private String coordinates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 简介
|
* 简介
|
||||||
|
|
@ -66,24 +64,6 @@ public class AirlineMarker extends ExBaseEntity {
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class PointInfo {
|
|
||||||
/**
|
|
||||||
* 纬度
|
|
||||||
*/
|
|
||||||
private Double latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度
|
|
||||||
*/
|
|
||||||
private Double longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 海拔高度
|
|
||||||
*/
|
|
||||||
private Double asl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -99,4 +79,4 @@ public class AirlineMarker extends ExBaseEntity {
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IAirlineMarkerGroupInfoService {
|
public interface IAirlineMarkerGroupInfoService {
|
||||||
|
|
||||||
int insertMarker(AirlineMarkerDTO dto);
|
AirlineMarkerDTO insertMarker(AirlineMarkerDTO dto);
|
||||||
|
|
||||||
int deleteMarker(AirlineMarkerDTO dto);
|
int deleteMarker(AirlineMarkerDTO dto);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标注Service转换类
|
* 标注Service转换类
|
||||||
|
|
@ -15,7 +14,6 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, AirlineMarkerDTO>
|
public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, AirlineMarkerDTO>
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final AirlineMarkerServiceConvert INSTANCE = new AirlineMarkerServiceConvert();
|
private static final AirlineMarkerServiceConvert INSTANCE = new AirlineMarkerServiceConvert();
|
||||||
|
|
||||||
private AirlineMarkerServiceConvert() {
|
private AirlineMarkerServiceConvert() {
|
||||||
|
|
@ -51,20 +49,7 @@ public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, Airl
|
||||||
dto.setColor(model.getColor());
|
dto.setColor(model.getColor());
|
||||||
dto.setIcon(model.getIcon());
|
dto.setIcon(model.getIcon());
|
||||||
dto.setFontSize(model.getFontSize());
|
dto.setFontSize(model.getFontSize());
|
||||||
|
dto.setCoordinates(model.getCoordinates());
|
||||||
// 转换coordinates
|
|
||||||
if (model.getCoordinates() != null) {
|
|
||||||
dto.setCoordinates(model.getCoordinates().stream()
|
|
||||||
.map(point -> {
|
|
||||||
AirlineMarkerDTO.PointInfo dtoPoint = new AirlineMarkerDTO.PointInfo();
|
|
||||||
dtoPoint.setLatitude(point.getLatitude());
|
|
||||||
dtoPoint.setLongitude(point.getLongitude());
|
|
||||||
dtoPoint.setAsl(point.getAsl());
|
|
||||||
return dtoPoint;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
|
|
||||||
dto.setDescription(model.getDescription());
|
dto.setDescription(model.getDescription());
|
||||||
dto.setCreateBy(model.getCreateBy());
|
dto.setCreateBy(model.getCreateBy());
|
||||||
dto.setCreateTime(model.getCreateTime());
|
dto.setCreateTime(model.getCreateTime());
|
||||||
|
|
@ -86,20 +71,7 @@ public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, Airl
|
||||||
model.setColor(dto.getColor());
|
model.setColor(dto.getColor());
|
||||||
model.setIcon(dto.getIcon());
|
model.setIcon(dto.getIcon());
|
||||||
model.setFontSize(dto.getFontSize());
|
model.setFontSize(dto.getFontSize());
|
||||||
|
model.setCoordinates(dto.getCoordinates());
|
||||||
// 转换coordinates
|
|
||||||
if (dto.getCoordinates() != null) {
|
|
||||||
model.setCoordinates(dto.getCoordinates().stream()
|
|
||||||
.map(point -> {
|
|
||||||
AirlineMarker.PointInfo modelPoint = new AirlineMarker.PointInfo();
|
|
||||||
modelPoint.setLatitude(point.getLatitude());
|
|
||||||
modelPoint.setLongitude(point.getLongitude());
|
|
||||||
modelPoint.setAsl(point.getAsl());
|
|
||||||
return modelPoint;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
|
|
||||||
model.setDescription(dto.getDescription());
|
model.setDescription(dto.getDescription());
|
||||||
model.setCreateBy(dto.getCreateBy());
|
model.setCreateBy(dto.getCreateBy());
|
||||||
model.setCreateTime(dto.getCreateTime());
|
model.setCreateTime(dto.getCreateTime());
|
||||||
|
|
@ -107,4 +79,4 @@ public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, Airl
|
||||||
model.setUpdateTime(dto.getUpdateTime());
|
model.setUpdateTime(dto.getUpdateTime());
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,8 +6,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标注表 airline_marker
|
* 标注表 airline_marker
|
||||||
*
|
*
|
||||||
|
|
@ -52,9 +50,9 @@ public class AirlineMarkerDTO extends BaseEntity {
|
||||||
private Integer fontSize;
|
private Integer fontSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经纬度,格式:[经,纬,asl高度]
|
* 坐标JSON字符串
|
||||||
*/
|
*/
|
||||||
private List<PointInfo> coordinates;
|
private String coordinates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 简介
|
* 简介
|
||||||
|
|
@ -66,24 +64,6 @@ public class AirlineMarkerDTO extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long groupId;
|
private Long groupId;
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class PointInfo {
|
|
||||||
/**
|
|
||||||
* 纬度
|
|
||||||
*/
|
|
||||||
private Double latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度
|
|
||||||
*/
|
|
||||||
private Double longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 海拔高度
|
|
||||||
*/
|
|
||||||
private Double asl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -35,20 +35,27 @@ public class AirlineMarkerGroupInfoServiceImpl implements IAirlineMarkerGroupInf
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertMarker(AirlineMarkerDTO dto) {
|
public AirlineMarkerDTO insertMarker(AirlineMarkerDTO dto) {
|
||||||
AirlineMarker model = AirlineMarkerServiceConvert.to(dto);
|
AirlineMarker model = AirlineMarkerServiceConvert.to(dto);
|
||||||
int result = iAirlineMarkerDomain.insertMarker(model);
|
int result = iAirlineMarkerDomain.insertMarker(model);
|
||||||
|
|
||||||
// 处理分组关系
|
// 处理分组关系
|
||||||
if (result > 0 && dto.getGroupId() != null) {
|
if (result > 0) {
|
||||||
AirlineMarkerGroupInfo groupInfo = new AirlineMarkerGroupInfo();
|
Long groupId = dto.getGroupId();
|
||||||
groupInfo.setGroupId(dto.getGroupId());
|
if (groupId != null) {
|
||||||
groupInfo.setMarkerId(model.getId());
|
AirlineMarkerGroupInfo groupInfo = new AirlineMarkerGroupInfo();
|
||||||
groupInfo.setCreateBy(dto.getCreateBy());
|
groupInfo.setGroupId(groupId);
|
||||||
groupInfo.setUpdateBy(dto.getUpdateBy());
|
groupInfo.setMarkerId(model.getId());
|
||||||
iAirlineMarkerGroupInfoDomain.insertMarkerGroupInfo(groupInfo);
|
groupInfo.setCreateBy(dto.getCreateBy());
|
||||||
|
groupInfo.setUpdateBy(dto.getUpdateBy());
|
||||||
|
iAirlineMarkerGroupInfoDomain.insertMarkerGroupInfo(groupInfo);
|
||||||
|
}
|
||||||
|
// 转换回 DTO 并设置 groupId
|
||||||
|
AirlineMarkerDTO resultDto = AirlineMarkerServiceConvert.from(model);
|
||||||
|
resultDto.setGroupId(groupId);
|
||||||
|
return resultDto;
|
||||||
}
|
}
|
||||||
return result;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteMarker(AirlineMarkerDTO dto) {
|
public int deleteMarker(AirlineMarkerDTO dto) {
|
||||||
|
|
@ -101,22 +108,35 @@ public class AirlineMarkerGroupInfoServiceImpl implements IAirlineMarkerGroupInf
|
||||||
public AirlineMarkerGroupInfoDTO selectMarkersByGroupId(Long groupId) {
|
public AirlineMarkerGroupInfoDTO selectMarkersByGroupId(Long groupId) {
|
||||||
AirlineMarkerGroupInfoDTO dto = new AirlineMarkerGroupInfoDTO();
|
AirlineMarkerGroupInfoDTO dto = new AirlineMarkerGroupInfoDTO();
|
||||||
dto.setGroupId(groupId);
|
dto.setGroupId(groupId);
|
||||||
|
|
||||||
// 先获取该分组下的所有标注ID
|
// 先获取该分组下的所有标注ID
|
||||||
AirlineMarkerGroupInfo airlineMarkerGroupInfo = new AirlineMarkerGroupInfo();
|
AirlineMarkerGroupInfo airlineMarkerGroupInfo = new AirlineMarkerGroupInfo();
|
||||||
airlineMarkerGroupInfo.setGroupId(groupId);
|
airlineMarkerGroupInfo.setGroupId(groupId);
|
||||||
List<AirlineMarkerGroupInfo> airlineMarkerGroupInfos= iAirlineMarkerGroupInfoDomain.selectMarkerGroupInfoList(airlineMarkerGroupInfo);
|
List<AirlineMarkerGroupInfo> airlineMarkerGroupInfos= iAirlineMarkerGroupInfoDomain.selectMarkerGroupInfoList(airlineMarkerGroupInfo);
|
||||||
List<Long> markerIds = airlineMarkerGroupInfos.stream().map(AirlineMarkerGroupInfo::getMarkerId).toList();
|
List<Long> markerIds = airlineMarkerGroupInfos.stream().map(AirlineMarkerGroupInfo::getMarkerId).toList();
|
||||||
|
|
||||||
if (markerIds != null && !markerIds.isEmpty()) {
|
if (markerIds != null && !markerIds.isEmpty()) {
|
||||||
|
// 建立 markerId -> groupId 的映射
|
||||||
|
java.util.Map<Long, Long> markerGroupMap = new java.util.HashMap<>();
|
||||||
|
for (AirlineMarkerGroupInfo info : airlineMarkerGroupInfos) {
|
||||||
|
markerGroupMap.put(info.getMarkerId(), info.getGroupId());
|
||||||
|
}
|
||||||
|
|
||||||
// 根据ID列表查询标注详情
|
// 根据ID列表查询标注详情
|
||||||
List<AirlineMarker> markers = iAirlineMarkerDomain.selectMarkerListByIds(markerIds);
|
List<AirlineMarker> markers = iAirlineMarkerDomain.selectMarkerListByIds(markerIds);
|
||||||
if (markers != null && !markers.isEmpty()) {
|
if (markers != null && !markers.isEmpty()) {
|
||||||
List<AirlineMarkerDTO> markerDTOs = AirlineMarkerServiceConvert.fromList(markers);
|
List<AirlineMarkerDTO> markerDTOs = new java.util.ArrayList<>();
|
||||||
|
for (AirlineMarker marker : markers) {
|
||||||
|
AirlineMarkerDTO markerDTO = AirlineMarkerServiceConvert.from(marker);
|
||||||
|
if (markerGroupMap.containsKey(marker.getId())) {
|
||||||
|
markerDTO.setGroupId(markerGroupMap.get(marker.getId()));
|
||||||
|
}
|
||||||
|
markerDTOs.add(markerDTO);
|
||||||
|
}
|
||||||
dto.setGroupInfos(markerDTOs);
|
dto.setGroupInfos(markerDTOs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
and am.status = 1
|
|
||||||
order by am.update_time desc
|
order by am.update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue