feat:提交标注代码
This commit is contained in:
parent
7a661add52
commit
d56262fc34
|
|
@ -0,0 +1,94 @@
|
|||
package com.ruoyi.airline.controller;
|
||||
|
||||
import com.ruoyi.airline.api.domain.AirlineMarkerVO;
|
||||
import com.ruoyi.airline.controller.convert.AirlineMarkerControllerConvert;
|
||||
import com.ruoyi.airline.service.api.IAirlineMarkerService;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/marker")
|
||||
@Tag(name = "标注管理")
|
||||
public class AirlineMarkerController extends BaseController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AirlineMarkerController.class);
|
||||
|
||||
@Autowired
|
||||
private IAirlineMarkerService iAirlineMarkerService;
|
||||
|
||||
/**
|
||||
* 获取标注列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取标注列表")
|
||||
public TableDataInfo list(AirlineMarkerVO airlineMarkerVO) {
|
||||
startPage();
|
||||
AirlineMarkerDTO dto = AirlineMarkerControllerConvert.to(airlineMarkerVO);
|
||||
List<AirlineMarkerDTO> list = iAirlineMarkerService.selectMarkerList(dto);
|
||||
List<AirlineMarkerVO> result = AirlineMarkerControllerConvert.fromList(list);
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标注详情
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "获取标注详情")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
AirlineMarkerDTO dto = iAirlineMarkerService.selectMarkerById(id);
|
||||
AirlineMarkerVO result = AirlineMarkerControllerConvert.from(dto);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标注
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "新增标注")
|
||||
public AjaxResult add(@Validated @RequestBody AirlineMarkerVO marker) {
|
||||
marker.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
marker.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
AirlineMarkerDTO dto = AirlineMarkerControllerConvert.to(marker);
|
||||
return toAjax(iAirlineMarkerService.insertMarker(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标注
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改标注")
|
||||
public AjaxResult edit(@Validated @RequestBody AirlineMarkerVO marker) {
|
||||
marker.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
AirlineMarkerDTO dto = AirlineMarkerControllerConvert.to(marker);
|
||||
return toAjax(iAirlineMarkerService.updateMarker(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标注(软删除)
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除标注")
|
||||
public AjaxResult remove(@PathVariable Long id) {
|
||||
AirlineMarkerDTO dto = new AirlineMarkerDTO();
|
||||
dto.setId(id);
|
||||
dto.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
return toAjax(iAirlineMarkerService.deleteMarker(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.ruoyi.airline.controller.convert;
|
||||
|
||||
import com.ruoyi.airline.api.domain.AirlineMarkerVO;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||
import com.ruoyi.common.core.utils.BaseConvert;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注Controller转换类
|
||||
* 用于API VO和Service DTO之间的转换
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public class AirlineMarkerControllerConvert extends BaseConvert<AirlineMarkerDTO, AirlineMarkerVO>
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(AirlineMarkerControllerConvert.class);
|
||||
|
||||
private static final AirlineMarkerControllerConvert INSTANCE = new AirlineMarkerControllerConvert();
|
||||
|
||||
private AirlineMarkerControllerConvert() {
|
||||
super(AirlineMarkerDTO.class, AirlineMarkerVO.class);
|
||||
}
|
||||
|
||||
public static AirlineMarkerVO from(AirlineMarkerDTO dto)
|
||||
{
|
||||
return INSTANCE.innerFrom(dto);
|
||||
}
|
||||
|
||||
public static AirlineMarkerDTO to(AirlineMarkerVO vo)
|
||||
{
|
||||
return INSTANCE.innerTo(vo);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerVO> fromList(List<AirlineMarkerDTO> dtoList)
|
||||
{
|
||||
return INSTANCE.innerFromList(dtoList);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerDTO> toList(List<AirlineMarkerVO> voList)
|
||||
{
|
||||
return INSTANCE.innerToList(voList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerVO innerFrom(AirlineMarkerDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerVO vo = new AirlineMarkerVO();
|
||||
vo.setId(dto.getId());
|
||||
vo.setMarkerName(dto.getMarkerName());
|
||||
vo.setMarkerType(dto.getMarkerType());
|
||||
vo.setStatus(dto.getStatus());
|
||||
vo.setColor(dto.getColor());
|
||||
vo.setIcon(dto.getIcon());
|
||||
vo.setFontSize(dto.getFontSize());
|
||||
vo.setCoordinates(dto.getCoordinates());
|
||||
vo.setDescription(dto.getDescription());
|
||||
vo.setGroupId(dto.getGroupId());
|
||||
vo.setCreateBy(dto.getCreateBy());
|
||||
vo.setCreateTime(dto.getCreateTime());
|
||||
vo.setUpdateBy(dto.getUpdateBy());
|
||||
vo.setUpdateTime(dto.getUpdateTime());
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerDTO innerTo(AirlineMarkerVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerDTO dto = new AirlineMarkerDTO();
|
||||
dto.setId(vo.getId());
|
||||
dto.setMarkerName(vo.getMarkerName());
|
||||
dto.setMarkerType(vo.getMarkerType());
|
||||
dto.setStatus(vo.getStatus());
|
||||
dto.setColor(vo.getColor());
|
||||
dto.setIcon(vo.getIcon());
|
||||
dto.setFontSize(vo.getFontSize());
|
||||
dto.setCoordinates(vo.getCoordinates());
|
||||
dto.setDescription(vo.getDescription());
|
||||
dto.setGroupId(vo.getGroupId());
|
||||
dto.setCreateBy(vo.getCreateBy());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateBy(vo.getUpdateBy());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.airline.domain.api;
|
||||
|
||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public interface IAirlineMarkerDomain {
|
||||
|
||||
int insertMarker(AirlineMarker model);
|
||||
|
||||
int updateMarker(AirlineMarker model);
|
||||
|
||||
int deleteMarker(AirlineMarker model);
|
||||
|
||||
List<AirlineMarker> selectMarkerList(AirlineMarker model);
|
||||
|
||||
AirlineMarker selectMarkerById(Long id);
|
||||
|
||||
List<AirlineMarker> selectMarkerListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询标注列表
|
||||
* @param model 查询条件
|
||||
* @return 标注列表
|
||||
*/
|
||||
List<AirlineMarker> selectMarkerListByUserId(AirlineMarker model);
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.ruoyi.airline.domain.api;
|
||||
|
||||
import com.ruoyi.airline.domain.model.AirlineMarkerGroupInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public interface IAirlineMarkerGroupInfoDomain {
|
||||
|
||||
int insertMarkerGroupInfo(AirlineMarkerGroupInfo model);
|
||||
|
||||
int deleteMarkerGroupInfo(AirlineMarkerGroupInfo model);
|
||||
|
||||
List<AirlineMarkerGroupInfo> selectMarkerGroupInfoList(AirlineMarkerGroupInfo model);
|
||||
|
||||
List<Long> selectMarkerIdsByGroupId(Long groupId);
|
||||
|
||||
int deleteByGroupId(Long groupId);
|
||||
|
||||
int deleteByMarkerId(Long markerId);
|
||||
|
||||
int batchInsertMarkerGroupInfo(List<AirlineMarkerGroupInfo> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ruoyi.airline.domain.convert;
|
||||
|
||||
import com.ruoyi.common.core.utils.BaseConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注Domain转换类
|
||||
* 用于Domain模型和Mapper实体之间的转换
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public class AirlineMarkerDomainConvert extends BaseConvert<AirlineMarkerEntity, AirlineMarker>
|
||||
{
|
||||
private static final AirlineMarkerDomainConvert INSTANCE = new AirlineMarkerDomainConvert();
|
||||
|
||||
private AirlineMarkerDomainConvert() {
|
||||
super(AirlineMarkerEntity.class, AirlineMarker.class);
|
||||
}
|
||||
|
||||
public static AirlineMarker from(AirlineMarkerEntity entity)
|
||||
{
|
||||
return INSTANCE.innerFrom(entity);
|
||||
}
|
||||
|
||||
public static AirlineMarkerEntity to(AirlineMarker model)
|
||||
{
|
||||
return INSTANCE.innerTo(model);
|
||||
}
|
||||
|
||||
public static List<AirlineMarker> fromList(List<AirlineMarkerEntity> entityList)
|
||||
{
|
||||
return INSTANCE.innerFromList(entityList);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerEntity> toList(List<AirlineMarker> modelList)
|
||||
{
|
||||
return INSTANCE.innerToList(modelList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarker innerFrom(AirlineMarkerEntity entity) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarker model = new AirlineMarker();
|
||||
model.setId(entity.getId());
|
||||
model.setMarkerName(entity.getMarkerName());
|
||||
model.setMarkerType(entity.getMarkerType());
|
||||
model.setStatus(entity.getStatus());
|
||||
model.setColor(entity.getColor());
|
||||
model.setIcon(entity.getIcon());
|
||||
model.setFontSize(entity.getFontSize());
|
||||
model.setCoordinates(entity.getCoordinates());
|
||||
model.setDescription(entity.getDescription());
|
||||
model.setCreateBy(entity.getCreateBy());
|
||||
model.setCreateTime(entity.getCreateTime());
|
||||
model.setUpdateBy(entity.getUpdateBy());
|
||||
model.setUpdateTime(entity.getUpdateTime());
|
||||
model.setRemark(entity.getRemark());
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerEntity innerTo(AirlineMarker model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerEntity entity = new AirlineMarkerEntity();
|
||||
entity.setId(model.getId());
|
||||
entity.setMarkerName(model.getMarkerName());
|
||||
entity.setMarkerType(model.getMarkerType());
|
||||
entity.setStatus(model.getStatus());
|
||||
entity.setColor(model.getColor());
|
||||
entity.setIcon(model.getIcon());
|
||||
entity.setFontSize(model.getFontSize());
|
||||
entity.setCoordinates(model.getCoordinates());
|
||||
entity.setDescription(model.getDescription());
|
||||
entity.setCreateBy(model.getCreateBy());
|
||||
entity.setCreateTime(model.getCreateTime());
|
||||
entity.setUpdateBy(model.getUpdateBy());
|
||||
entity.setUpdateTime(model.getUpdateTime());
|
||||
entity.setRemark(model.getRemark());
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.ruoyi.airline.domain.convert;
|
||||
|
||||
import com.ruoyi.common.core.utils.BaseConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarkerGroupInfo;
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细Domain转换类
|
||||
* 用于Domain模型和Mapper实体之间的转换
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public class AirlineMarkerGroupInfoDomainConvert extends BaseConvert<AirlineMarkerGroupInfoEntity, AirlineMarkerGroupInfo>
|
||||
{
|
||||
private static final AirlineMarkerGroupInfoDomainConvert INSTANCE = new AirlineMarkerGroupInfoDomainConvert();
|
||||
|
||||
private AirlineMarkerGroupInfoDomainConvert() {
|
||||
super(AirlineMarkerGroupInfoEntity.class, AirlineMarkerGroupInfo.class);
|
||||
}
|
||||
|
||||
public static AirlineMarkerGroupInfo from(AirlineMarkerGroupInfoEntity entity)
|
||||
{
|
||||
return INSTANCE.innerFrom(entity);
|
||||
}
|
||||
|
||||
public static AirlineMarkerGroupInfoEntity to(AirlineMarkerGroupInfo model)
|
||||
{
|
||||
return INSTANCE.innerTo(model);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerGroupInfo> fromList(List<AirlineMarkerGroupInfoEntity> entityList)
|
||||
{
|
||||
return INSTANCE.innerFromList(entityList);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerGroupInfoEntity> toList(List<AirlineMarkerGroupInfo> modelList)
|
||||
{
|
||||
return INSTANCE.innerToList(modelList);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ruoyi.airline.domain.impl;
|
||||
|
||||
import com.ruoyi.airline.domain.api.IAirlineMarkerDomain;
|
||||
import com.ruoyi.airline.domain.convert.AirlineMarkerDomainConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||
import com.ruoyi.airline.mapper.AirlineMarkerMapper;
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@Component
|
||||
public class AirlineMarkerDomainImpl implements IAirlineMarkerDomain {
|
||||
|
||||
@Autowired
|
||||
private AirlineMarkerMapper airlineMarkerMapper;
|
||||
|
||||
@Override
|
||||
public int insertMarker(AirlineMarker model) {
|
||||
AirlineMarkerEntity entity = AirlineMarkerDomainConvert.to(model);
|
||||
int result = airlineMarkerMapper.insertMarker(entity);
|
||||
if (result > 0 && entity.getId() != null) {
|
||||
model.setId(entity.getId());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMarker(AirlineMarker model) {
|
||||
AirlineMarkerEntity entity = AirlineMarkerDomainConvert.to(model);
|
||||
return airlineMarkerMapper.updateMarker(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteMarker(AirlineMarker model) {
|
||||
AirlineMarkerEntity entity = AirlineMarkerDomainConvert.to(model);
|
||||
return airlineMarkerMapper.deleteMarker(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarker> selectMarkerList(AirlineMarker model) {
|
||||
AirlineMarkerEntity entity = AirlineMarkerDomainConvert.to(model);
|
||||
return AirlineMarkerDomainConvert.fromList(airlineMarkerMapper.selectMarkerList(entity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AirlineMarker selectMarkerById(Long id) {
|
||||
AirlineMarkerEntity entity = airlineMarkerMapper.selectMarkerById(id);
|
||||
return AirlineMarkerDomainConvert.from(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarker> selectMarkerListByIds(List<Long> ids) {
|
||||
return AirlineMarkerDomainConvert.fromList(airlineMarkerMapper.selectMarkerListByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarker> selectMarkerListByUserId(AirlineMarker model) {
|
||||
AirlineMarkerEntity entity = AirlineMarkerDomainConvert.to(model);
|
||||
return AirlineMarkerDomainConvert.fromList(airlineMarkerMapper.selectMarkerListByUserId(entity));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.airline.domain.impl;
|
||||
|
||||
import com.ruoyi.airline.domain.api.IAirlineMarkerGroupInfoDomain;
|
||||
import com.ruoyi.airline.domain.convert.AirlineMarkerGroupInfoDomainConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarkerGroupInfo;
|
||||
import com.ruoyi.airline.mapper.AirlineMarkerGroupInfoMapper;
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@Component
|
||||
public class AirlineMarkerGroupInfoDomainImpl implements IAirlineMarkerGroupInfoDomain {
|
||||
|
||||
@Autowired
|
||||
private AirlineMarkerGroupInfoMapper airlineMarkerGroupInfoMapper;
|
||||
|
||||
@Override
|
||||
public int insertMarkerGroupInfo(AirlineMarkerGroupInfo model) {
|
||||
model.setDelFlag(0L);
|
||||
AirlineMarkerGroupInfoEntity entity = AirlineMarkerGroupInfoDomainConvert.to(model);
|
||||
return airlineMarkerGroupInfoMapper.insertMarkerGroupInfo(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteMarkerGroupInfo(AirlineMarkerGroupInfo model) {
|
||||
model.setDelFlag(1L);
|
||||
AirlineMarkerGroupInfoEntity entity = AirlineMarkerGroupInfoDomainConvert.to(model);
|
||||
return airlineMarkerGroupInfoMapper.deleteMarkerGroupInfo(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarkerGroupInfo> selectMarkerGroupInfoList(AirlineMarkerGroupInfo model) {
|
||||
AirlineMarkerGroupInfoEntity entity = AirlineMarkerGroupInfoDomainConvert.to(model);
|
||||
return AirlineMarkerGroupInfoDomainConvert.fromList(airlineMarkerGroupInfoMapper.selectMarkerGroupInfoList(entity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectMarkerIdsByGroupId(Long groupId) {
|
||||
return airlineMarkerGroupInfoMapper.selectMarkerIdsByGroupId(groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByGroupId(Long groupId) {
|
||||
return airlineMarkerGroupInfoMapper.deleteByGroupId(groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByMarkerId(Long markerId) {
|
||||
return airlineMarkerGroupInfoMapper.deleteByMarkerId(markerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsertMarkerGroupInfo(List<AirlineMarkerGroupInfo> list) {
|
||||
List<AirlineMarkerGroupInfoEntity> entityList = AirlineMarkerGroupInfoDomainConvert.toList(list);
|
||||
return airlineMarkerGroupInfoMapper.batchInsertMarkerGroupInfo(entityList);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.ruoyi.airline.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarker extends ExBaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标注名称
|
||||
*/
|
||||
private String markerName;
|
||||
|
||||
/**
|
||||
* 标注类型
|
||||
*/
|
||||
private String markerType;
|
||||
|
||||
/**
|
||||
* 1 启用 0 停用。默认启用。
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 字体大小
|
||||
*/
|
||||
private Integer fontSize;
|
||||
|
||||
/**
|
||||
* 经纬度,格式:[经,纬,asl高度]
|
||||
*/
|
||||
private String coordinates;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("markerName", getMarkerName())
|
||||
.append("markerType", getMarkerType())
|
||||
.append("status", getStatus())
|
||||
.append("color", getColor())
|
||||
.append("icon", getIcon())
|
||||
.append("fontSize", getFontSize())
|
||||
.append("coordinates", getCoordinates())
|
||||
.append("description", getDescription())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.ruoyi.airline.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注分组明细
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarkerGroupInfo extends ExBaseEntity {
|
||||
/**
|
||||
* id,主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 标注id
|
||||
*/
|
||||
private Long markerId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("groupId", getGroupId())
|
||||
.append("markerId", getMarkerId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.ruoyi.airline.mapper;
|
||||
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细表 airline_marker_group_info
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@Mapper
|
||||
public interface AirlineMarkerGroupInfoMapper {
|
||||
|
||||
int insertMarkerGroupInfo(AirlineMarkerGroupInfoEntity entity);
|
||||
|
||||
int deleteMarkerGroupInfo(AirlineMarkerGroupInfoEntity entity);
|
||||
|
||||
List<AirlineMarkerGroupInfoEntity> selectMarkerGroupInfoList(AirlineMarkerGroupInfoEntity entity);
|
||||
|
||||
AirlineMarkerGroupInfoEntity selectMarkerGroupInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 根据分组ID删除标注分组信息
|
||||
* @param groupId 分组ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByGroupId(@Param("groupId") Long groupId);
|
||||
|
||||
/**
|
||||
* 根据标注ID删除标注分组信息
|
||||
* @param markerId 标注ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByMarkerId(@Param("markerId") Long markerId);
|
||||
|
||||
/**
|
||||
* 根据分组ID查询标注ID列表
|
||||
* @param groupId 分组ID
|
||||
* @return 标注ID列表
|
||||
*/
|
||||
List<Long> selectMarkerIdsByGroupId(@Param("groupId") Long groupId);
|
||||
|
||||
/**
|
||||
* 批量插入标注分组信息
|
||||
* @param list 标注分组信息列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int batchInsertMarkerGroupInfo(@Param("list") List<AirlineMarkerGroupInfoEntity> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.airline.mapper;
|
||||
|
||||
import com.ruoyi.airline.mapper.entity.AirlineMarkerEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注表 airline_marker
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public interface AirlineMarkerMapper {
|
||||
|
||||
int insertMarker(AirlineMarkerEntity entity);
|
||||
|
||||
int updateMarker(AirlineMarkerEntity entity);
|
||||
|
||||
int deleteMarker(AirlineMarkerEntity entity);
|
||||
|
||||
List<AirlineMarkerEntity> selectMarkerList(AirlineMarkerEntity entity);
|
||||
|
||||
AirlineMarkerEntity selectMarkerById(Long id);
|
||||
|
||||
List<AirlineMarkerEntity> selectMarkerListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询标注列表
|
||||
* @param entity 查询条件
|
||||
* @return 标注列表
|
||||
*/
|
||||
List<AirlineMarkerEntity> selectMarkerListByUserId(AirlineMarkerEntity entity);
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.ruoyi.airline.mapper.entity;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注表 airline_marker
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarkerEntity extends ExBaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标注名称
|
||||
*/
|
||||
private String markerName;
|
||||
|
||||
/**
|
||||
* 标注类型
|
||||
*/
|
||||
private String markerType;
|
||||
|
||||
/**
|
||||
* 1 启用 0 停用。默认启用。
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 字体大小
|
||||
*/
|
||||
private Integer fontSize;
|
||||
|
||||
/**
|
||||
* 经纬度,格式:[经,纬,asl高度]
|
||||
*/
|
||||
private String coordinates;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String description;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("markerName", getMarkerName())
|
||||
.append("markerType", getMarkerType())
|
||||
.append("status", getStatus())
|
||||
.append("color", getColor())
|
||||
.append("icon", getIcon())
|
||||
.append("fontSize", getFontSize())
|
||||
.append("coordinates", getCoordinates())
|
||||
.append("description", getDescription())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.ruoyi.airline.mapper.entity;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注分组明细表 airline_marker_group_info
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarkerGroupInfoEntity extends ExBaseEntity {
|
||||
/**
|
||||
* id,主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 标注id
|
||||
*/
|
||||
private Long markerId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("groupId", getGroupId())
|
||||
.append("markerId", getMarkerId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ruoyi.airline.service.api;
|
||||
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerGroupInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public interface IAirlineMarkerGroupInfoService {
|
||||
|
||||
int insertMarkerGroupInfo(AirlineMarkerGroupInfoDTO groupInfo);
|
||||
|
||||
int deleteMarkerGroupInfo(Long userId, Long groupId, Long markerId);
|
||||
|
||||
List<AirlineMarkerGroupInfoDTO> selectMarkerGroupInfoList(AirlineMarkerGroupInfoDTO dto);
|
||||
|
||||
List<Long> selectMarkerIdsByGroupId(Long groupId);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.airline.service.api;
|
||||
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注管理
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public interface IAirlineMarkerService {
|
||||
|
||||
int insertMarker(AirlineMarkerDTO marker);
|
||||
|
||||
int updateMarker(AirlineMarkerDTO marker);
|
||||
|
||||
int deleteMarker(AirlineMarkerDTO dto);
|
||||
|
||||
List<AirlineMarkerDTO> selectMarkerList(AirlineMarkerDTO dto);
|
||||
|
||||
AirlineMarkerDTO selectMarkerById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.ruoyi.airline.service.convert;
|
||||
|
||||
import com.ruoyi.common.core.utils.BaseConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarkerGroupInfo;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerGroupInfoDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细Service转换类
|
||||
* 用于Domain模型和Service DTO之间的转换
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public class AirlineMarkerGroupInfoServiceConvert extends BaseConvert<AirlineMarkerGroupInfo, AirlineMarkerGroupInfoDTO>
|
||||
{
|
||||
|
||||
private static final AirlineMarkerGroupInfoServiceConvert INSTANCE = new AirlineMarkerGroupInfoServiceConvert();
|
||||
|
||||
private AirlineMarkerGroupInfoServiceConvert() {
|
||||
super(AirlineMarkerGroupInfo.class, AirlineMarkerGroupInfoDTO.class);
|
||||
}
|
||||
|
||||
public static AirlineMarkerGroupInfoDTO from(AirlineMarkerGroupInfo model)
|
||||
{
|
||||
return INSTANCE.innerFrom(model);
|
||||
}
|
||||
|
||||
public static AirlineMarkerGroupInfo to(AirlineMarkerGroupInfoDTO dto)
|
||||
{
|
||||
return INSTANCE.innerTo(dto);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerGroupInfoDTO> fromList(List<AirlineMarkerGroupInfo> modelList)
|
||||
{
|
||||
return INSTANCE.innerFromList(modelList);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerGroupInfo> toList(List<AirlineMarkerGroupInfoDTO> dtoList)
|
||||
{
|
||||
return INSTANCE.innerToList(dtoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerGroupInfoDTO innerFrom(AirlineMarkerGroupInfo model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerGroupInfoDTO dto = new AirlineMarkerGroupInfoDTO();
|
||||
dto.setId(model.getId());
|
||||
dto.setGroupId(model.getGroupId());
|
||||
dto.setMarkerId(model.getMarkerId());
|
||||
dto.setCreateBy(model.getCreateBy());
|
||||
dto.setCreateTime(model.getCreateTime());
|
||||
dto.setUpdateBy(model.getUpdateBy());
|
||||
dto.setUpdateTime(model.getUpdateTime());
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerGroupInfo innerTo(AirlineMarkerGroupInfoDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerGroupInfo model = new AirlineMarkerGroupInfo();
|
||||
model.setId(dto.getId());
|
||||
model.setGroupId(dto.getGroupId());
|
||||
model.setMarkerId(dto.getMarkerId());
|
||||
model.setCreateBy(dto.getCreateBy());
|
||||
model.setCreateTime(dto.getCreateTime());
|
||||
model.setUpdateBy(dto.getUpdateBy());
|
||||
model.setUpdateTime(dto.getUpdateTime());
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.airline.service.convert;
|
||||
|
||||
import com.ruoyi.common.core.utils.BaseConvert;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注Service转换类
|
||||
* 用于Domain模型和Service DTO之间的转换
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
public class AirlineMarkerServiceConvert extends BaseConvert<AirlineMarker, AirlineMarkerDTO>
|
||||
{
|
||||
|
||||
private static final AirlineMarkerServiceConvert INSTANCE = new AirlineMarkerServiceConvert();
|
||||
|
||||
private AirlineMarkerServiceConvert() {
|
||||
super(AirlineMarker.class, AirlineMarkerDTO.class);
|
||||
}
|
||||
|
||||
public static AirlineMarkerDTO from(AirlineMarker model)
|
||||
{
|
||||
return INSTANCE.innerFrom(model);
|
||||
}
|
||||
|
||||
public static AirlineMarker to(AirlineMarkerDTO dto)
|
||||
{
|
||||
return INSTANCE.innerTo(dto);
|
||||
}
|
||||
|
||||
public static List<AirlineMarkerDTO> fromList(List<AirlineMarker> modelList)
|
||||
{
|
||||
return INSTANCE.innerFromList(modelList);
|
||||
}
|
||||
|
||||
public static List<AirlineMarker> toList(List<AirlineMarkerDTO> dtoList)
|
||||
{
|
||||
return INSTANCE.innerToList(dtoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarkerDTO innerFrom(AirlineMarker model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarkerDTO dto = new AirlineMarkerDTO();
|
||||
dto.setId(model.getId());
|
||||
dto.setMarkerName(model.getMarkerName());
|
||||
dto.setMarkerType(model.getMarkerType());
|
||||
dto.setStatus(model.getStatus());
|
||||
dto.setColor(model.getColor());
|
||||
dto.setIcon(model.getIcon());
|
||||
dto.setFontSize(model.getFontSize());
|
||||
dto.setCoordinates(model.getCoordinates());
|
||||
dto.setDescription(model.getDescription());
|
||||
dto.setCreateBy(model.getCreateBy());
|
||||
dto.setCreateTime(model.getCreateTime());
|
||||
dto.setUpdateBy(model.getUpdateBy());
|
||||
dto.setUpdateTime(model.getUpdateTime());
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AirlineMarker innerTo(AirlineMarkerDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
AirlineMarker model = new AirlineMarker();
|
||||
model.setId(dto.getId());
|
||||
model.setMarkerName(dto.getMarkerName());
|
||||
model.setMarkerType(dto.getMarkerType());
|
||||
model.setStatus(dto.getStatus());
|
||||
model.setColor(dto.getColor());
|
||||
model.setIcon(dto.getIcon());
|
||||
model.setFontSize(dto.getFontSize());
|
||||
model.setCoordinates(dto.getCoordinates());
|
||||
model.setDescription(dto.getDescription());
|
||||
model.setCreateBy(dto.getCreateBy());
|
||||
model.setCreateTime(dto.getCreateTime());
|
||||
model.setUpdateBy(dto.getUpdateBy());
|
||||
model.setUpdateTime(dto.getUpdateTime());
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.ruoyi.airline.service.dto;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注表 airline_marker
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarkerDTO extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标注名称
|
||||
*/
|
||||
private String markerName;
|
||||
|
||||
/**
|
||||
* 标注类型
|
||||
*/
|
||||
private String markerType;
|
||||
|
||||
/**
|
||||
* 1 启用 0 停用。默认启用。
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 字体大小
|
||||
*/
|
||||
private Integer fontSize;
|
||||
|
||||
/**
|
||||
* 经纬度,格式:[经,纬,asl高度]
|
||||
*/
|
||||
private String coordinates;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("markerName", getMarkerName())
|
||||
.append("markerType", getMarkerType())
|
||||
.append("status", getStatus())
|
||||
.append("color", getColor())
|
||||
.append("icon", getIcon())
|
||||
.append("fontSize", getFontSize())
|
||||
.append("coordinates", getCoordinates())
|
||||
.append("description", getDescription())
|
||||
.append("groupId", getGroupId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.ruoyi.airline.service.dto;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 标注分组明细表 airline_marker_group_info
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AirlineMarkerGroupInfoDTO extends BaseEntity {
|
||||
/**
|
||||
* id,主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 标注id
|
||||
*/
|
||||
private Long markerId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("groupId", getGroupId())
|
||||
.append("markerId", getMarkerId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.ruoyi.airline.service.impl;
|
||||
|
||||
import com.ruoyi.airline.domain.api.IAirlineMarkerGroupInfoDomain;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarkerGroupInfo;
|
||||
import com.ruoyi.airline.service.api.IAirlineMarkerGroupInfoService;
|
||||
import com.ruoyi.airline.service.convert.AirlineMarkerGroupInfoServiceConvert;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerGroupInfoDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注分组明细Service实现类
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@Service
|
||||
public class AirlineMarkerGroupInfoServiceImpl implements IAirlineMarkerGroupInfoService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AirlineMarkerGroupInfoServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private IAirlineMarkerGroupInfoDomain iAirlineMarkerGroupInfoDomain;
|
||||
|
||||
@Override
|
||||
public int insertMarkerGroupInfo(AirlineMarkerGroupInfoDTO groupInfo) {
|
||||
AirlineMarkerGroupInfo model = AirlineMarkerGroupInfoServiceConvert.to(groupInfo);
|
||||
return iAirlineMarkerGroupInfoDomain.insertMarkerGroupInfo(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteMarkerGroupInfo(Long userId, Long groupId, Long markerId) {
|
||||
AirlineMarkerGroupInfo model = new AirlineMarkerGroupInfo();
|
||||
model.setGroupId(groupId);
|
||||
model.setMarkerId(markerId);
|
||||
model.setDeletedBy(userId != null ? userId.toString() : "");
|
||||
return iAirlineMarkerGroupInfoDomain.deleteMarkerGroupInfo(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarkerGroupInfoDTO> selectMarkerGroupInfoList(AirlineMarkerGroupInfoDTO dto) {
|
||||
AirlineMarkerGroupInfo model = AirlineMarkerGroupInfoServiceConvert.to(dto);
|
||||
return AirlineMarkerGroupInfoServiceConvert.fromList(iAirlineMarkerGroupInfoDomain.selectMarkerGroupInfoList(model));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectMarkerIdsByGroupId(Long groupId) {
|
||||
return iAirlineMarkerGroupInfoDomain.selectMarkerIdsByGroupId(groupId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.ruoyi.airline.service.impl;
|
||||
|
||||
import com.ruoyi.airline.domain.api.IAirlineMarkerDomain;
|
||||
import com.ruoyi.airline.domain.model.AirlineMarker;
|
||||
import com.ruoyi.airline.service.api.IAirlineMarkerService;
|
||||
import com.ruoyi.airline.service.api.IAirlineMarkerGroupInfoService;
|
||||
import com.ruoyi.airline.service.convert.AirlineMarkerServiceConvert;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerDTO;
|
||||
import com.ruoyi.airline.service.dto.AirlineMarkerGroupInfoDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标注Service实现类
|
||||
*
|
||||
* @author 拓恒
|
||||
*/
|
||||
@Service
|
||||
public class AirlineMarkerServiceImpl implements IAirlineMarkerService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AirlineMarkerServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private IAirlineMarkerDomain iAirlineMarkerDomain;
|
||||
|
||||
@Autowired
|
||||
private IAirlineMarkerGroupInfoService iAirlineMarkerGroupInfoService;
|
||||
|
||||
@Override
|
||||
public int insertMarker(AirlineMarkerDTO marker) {
|
||||
AirlineMarker model = AirlineMarkerServiceConvert.to(marker);
|
||||
int result = iAirlineMarkerDomain.insertMarker(model);
|
||||
|
||||
// 处理分组关系
|
||||
if (result > 0 && marker.getGroupId() != null) {
|
||||
AirlineMarkerGroupInfoDTO groupInfo = new AirlineMarkerGroupInfoDTO();
|
||||
groupInfo.setGroupId(marker.getGroupId());
|
||||
groupInfo.setMarkerId(model.getId());
|
||||
groupInfo.setCreateBy(marker.getCreateBy());
|
||||
groupInfo.setUpdateBy(marker.getUpdateBy());
|
||||
iAirlineMarkerGroupInfoService.insertMarkerGroupInfo(groupInfo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMarker(AirlineMarkerDTO marker) {
|
||||
AirlineMarker model = AirlineMarkerServiceConvert.to(marker);
|
||||
int result = iAirlineMarkerDomain.updateMarker(model);
|
||||
|
||||
// 处理分组关系
|
||||
if (result > 0 && marker.getGroupId() != null) {
|
||||
// 先删除旧的关系
|
||||
iAirlineMarkerGroupInfoService.deleteMarkerGroupInfo(0L, null, marker.getId());
|
||||
// 再创建新的关系
|
||||
AirlineMarkerGroupInfoDTO groupInfo = new AirlineMarkerGroupInfoDTO();
|
||||
groupInfo.setGroupId(marker.getGroupId());
|
||||
groupInfo.setMarkerId(marker.getId());
|
||||
groupInfo.setCreateBy(marker.getUpdateBy());
|
||||
groupInfo.setUpdateBy(marker.getUpdateBy());
|
||||
iAirlineMarkerGroupInfoService.insertMarkerGroupInfo(groupInfo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteMarker(AirlineMarkerDTO dto) {
|
||||
// 获取当前用户 ID
|
||||
Long currentUserId = SecurityUtils.getUserId();
|
||||
|
||||
// 先删除分组关系
|
||||
iAirlineMarkerGroupInfoService.deleteMarkerGroupInfo(currentUserId, dto.getGroupId(), dto.getId());
|
||||
|
||||
// 再删除标注(软删除)
|
||||
AirlineMarker model = new AirlineMarker();
|
||||
model.setId(dto.getId());
|
||||
model.setUpdateBy(currentUserId.toString());
|
||||
return iAirlineMarkerDomain.deleteMarker(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirlineMarkerDTO> selectMarkerList(AirlineMarkerDTO dto) {
|
||||
AirlineMarker model = AirlineMarkerServiceConvert.to(dto);
|
||||
return AirlineMarkerServiceConvert.fromList(iAirlineMarkerDomain.selectMarkerList(model));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AirlineMarkerDTO selectMarkerById(Long id) {
|
||||
AirlineMarker model = iAirlineMarkerDomain.selectMarkerById(id);
|
||||
AirlineMarkerDTO dto = AirlineMarkerServiceConvert.from(model);
|
||||
|
||||
// 查询分组关系
|
||||
AirlineMarkerGroupInfoDTO groupInfoDTO = new AirlineMarkerGroupInfoDTO();
|
||||
groupInfoDTO.setMarkerId(id);
|
||||
List<AirlineMarkerGroupInfoDTO> groupInfos = iAirlineMarkerGroupInfoService.selectMarkerGroupInfoList(groupInfoDTO);
|
||||
if (!groupInfos.isEmpty()) {
|
||||
dto.setGroupId(groupInfos.get(0).getGroupId());
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
-- 创建标注表
|
||||
CREATE TABLE IF NOT EXISTS airline_marker (
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
marker_name VARCHAR(255) NOT NULL COMMENT '标注名称',
|
||||
marker_type VARCHAR(255) COMMENT '标注类型',
|
||||
status INT(11) DEFAULT 1 COMMENT '1 启用 0 停用。默认启用。',
|
||||
color VARCHAR(255) DEFAULT '#000000' COMMENT '颜色',
|
||||
icon VARCHAR(255) DEFAULT NULL COMMENT '图标',
|
||||
font_size INT(11) DEFAULT 14 COMMENT '字体大小',
|
||||
coordinates JSON COMMENT '经纬度,格式:[经,纬,asl高度]',
|
||||
description TEXT COMMENT '简介',
|
||||
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
create_time DATETIME COMMENT '创建时间',
|
||||
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
update_time DATETIME COMMENT '更新时间',
|
||||
remark VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='标注表';
|
||||
|
||||
-- 创建标注分组明细表(与空域共用分组)
|
||||
CREATE TABLE IF NOT EXISTS airline_marker_group_info (
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'id,主键',
|
||||
group_id BIGINT(20) NOT NULL COMMENT '分组ID',
|
||||
marker_id BIGINT(20) NOT NULL COMMENT '标注id',
|
||||
del_flag BIGINT(20) DEFAULT 0 COMMENT '删除标识,0.未删除(默认);1,已删除',
|
||||
deleted_by VARCHAR(64) DEFAULT '' COMMENT '删除者',
|
||||
deleted_time DATETIME COMMENT '删除时间',
|
||||
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
create_time DATETIME COMMENT '创建时间',
|
||||
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
update_time DATETIME COMMENT '更新时间',
|
||||
remark VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (id),
|
||||
INDEX idx_group_id (group_id),
|
||||
INDEX idx_marker_id (marker_id)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='标注分组明细表';
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<?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.airline.mapper.AirlineMarkerGroupInfoMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="AirlineMarkerGroupInfoResult" type="com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity">
|
||||
<id property="id" column="id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="markerId" column="marker_id" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
<result property="deletedBy" column="deleted_by" />
|
||||
<result property="deletedTime" column="deleted_time" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 插入分组明细 -->
|
||||
<insert id="insertMarkerGroupInfo" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity">
|
||||
insert into airline_marker_group_info (group_id, marker_id, create_by, create_time, update_by, update_time, del_flag)
|
||||
values (#{groupId}, #{markerId}, #{createBy}, now(), #{updateBy}, now(), 0)
|
||||
</insert>
|
||||
|
||||
<!-- 删除分组明细(软删除) -->
|
||||
<update id="deleteMarkerGroupInfo" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity">
|
||||
update airline_marker_group_info
|
||||
set del_flag = 1,
|
||||
deleted_by = #{deletedBy},
|
||||
deleted_time = now()
|
||||
where 1=1
|
||||
<if test="groupId != null">
|
||||
and group_id = #{groupId}
|
||||
</if>
|
||||
<if test="markerId != null">
|
||||
and marker_id = #{markerId}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- 查询分组明细列表 -->
|
||||
<select id="selectMarkerGroupInfoList" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerGroupInfoEntity" resultMap="AirlineMarkerGroupInfoResult">
|
||||
select id, group_id, marker_id, create_by, create_time, update_by, update_time, del_flag, deleted_by, deleted_time
|
||||
from airline_marker_group_info
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="groupId != null">
|
||||
and group_id = #{groupId}
|
||||
</if>
|
||||
<if test="markerId != null">
|
||||
and marker_id = #{markerId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据分组ID删除标注分组信息 -->
|
||||
<delete id="deleteByGroupId" parameterType="java.lang.Long">
|
||||
delete from airline_marker_group_info where group_id = #{groupId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据标注ID删除标注分组信息 -->
|
||||
<delete id="deleteByMarkerId" parameterType="java.lang.Long">
|
||||
delete from airline_marker_group_info where marker_id = #{markerId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据分组ID查询标注ID列表 -->
|
||||
<select id="selectMarkerIdsByGroupId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
select marker_id
|
||||
from airline_marker_group_info
|
||||
where group_id = #{groupId}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- 批量插入标注分组信息 -->
|
||||
<insert id="batchInsertMarkerGroupInfo" parameterType="java.util.List">
|
||||
insert into airline_marker_group_info (group_id, marker_id, create_by, create_time, update_by, update_time, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.groupId}, #{item.markerId}, #{item.createBy}, now(), #{item.updateBy}, now(), 0)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?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.airline.mapper.AirlineMarkerMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="AirlineMarkerResult" type="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
|
||||
<id property="id" column="id" />
|
||||
<result property="markerName" column="marker_name" />
|
||||
<result property="markerType" column="marker_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="color" column="color" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="fontSize" column="font_size" />
|
||||
<result property="coordinates" column="coordinates" />
|
||||
<result property="description" column="description" />
|
||||
<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>
|
||||
|
||||
<!-- 插入标注 -->
|
||||
<insert id="insertMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into airline_marker (marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark)
|
||||
values (#{markerName}, #{markerType}, #{status}, #{color}, #{icon}, #{fontSize}, #{coordinates}, #{description}, #{createBy}, now(), #{updateBy}, now(), #{remark})
|
||||
</insert>
|
||||
|
||||
<!-- 更新标注 -->
|
||||
<update id="updateMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
|
||||
update airline_marker
|
||||
set marker_name = #{markerName},
|
||||
marker_type = #{markerType},
|
||||
status = #{status},
|
||||
color = #{color},
|
||||
icon = #{icon},
|
||||
font_size = #{fontSize},
|
||||
coordinates = #{coordinates},
|
||||
description = #{description},
|
||||
update_by = #{updateBy},
|
||||
update_time = now(),
|
||||
remark = #{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除标注 -->
|
||||
<update id="deleteMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
|
||||
update airline_marker
|
||||
set status = 0,
|
||||
update_by = #{updateBy},
|
||||
update_time = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 查询标注列表 -->
|
||||
<select id="selectMarkerList" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" resultMap="AirlineMarkerResult">
|
||||
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
|
||||
from airline_marker
|
||||
<where>
|
||||
<if test="markerName != null and markerName != ''">
|
||||
and marker_name like concat('%', #{markerName}, '%')
|
||||
</if>
|
||||
<if test="markerType != null and markerType != ''">
|
||||
and marker_type = #{markerType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询标注 -->
|
||||
<select id="selectMarkerById" parameterType="java.lang.Long" resultMap="AirlineMarkerResult">
|
||||
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
|
||||
from airline_marker
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID列表查询标注 -->
|
||||
<select id="selectMarkerListByIds" parameterType="java.util.List" resultMap="AirlineMarkerResult">
|
||||
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
|
||||
from airline_marker
|
||||
where id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID查询标注列表 -->
|
||||
<select id="selectMarkerListByUserId" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" resultMap="AirlineMarkerResult">
|
||||
select distinct am.id, am.marker_name, am.marker_type, am.status, am.color, am.icon, am.font_size, am.coordinates, am.description, am.create_by, am.create_time, am.update_by, am.update_time, am.remark
|
||||
from airline_marker am
|
||||
left join airline_marker_group_info amgi on am.id = amgi.marker_id
|
||||
left join airline_area_group aag on amgi.group_id = aag.group_id
|
||||
<where>
|
||||
amgi.del_flag = 0
|
||||
and aag.del_flag = 0
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and am.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="markerName != null and markerName != ''">
|
||||
and am.marker_name like concat('%', #{markerName}, '%')
|
||||
</if>
|
||||
<if test="markerType != null and markerType != ''">
|
||||
and am.marker_type = #{markerType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and am.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue