添加pois数据对应的后台接口

删除原关键字查询相关代码,生成逻辑有误
This commit is contained in:
仙风道骨小半仙儿 2025-03-25 21:54:36 +08:00
parent 014b42aad2
commit 46cdafd779
30 changed files with 762 additions and 1038 deletions

View File

@ -4,5 +4,7 @@ public interface ErrorCodeConstants {
// ========== 高德关键字搜索记录 1-050-000-000 ==========
// ========== 高德关键字搜索记录 TODO 补充编号 ==========
ErrorCode KEYWORD_SEARCH_NOT_EXISTS = new ErrorCode(1_050_000_000, "高德关键字搜索记录不存在");
ErrorCode KEYWORD_SEARCH_NOT_EXISTS = new ErrorCode(1_050_001_000, "高德关键字搜索记录不存在");
ErrorCode POIS_NOT_EXISTS = new ErrorCode(1_050_002_000, "高德POI基础信息不存在");
}

View File

@ -1,155 +0,0 @@
package cn.iocoder.yudao.module.map.controller.admin.keywordsearch;
import cn.hutool.core.collection.CollUtil;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.KeywordSearchDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisIndoorDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisPhotosDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisDO;
import cn.iocoder.yudao.module.map.service.keywordsearch.KeywordSearchService;
@Tag(name = "管理后台 - 高德关键字搜索记录")
@RestController
@RequestMapping("/map/keyword-search")
@Validated
public class KeywordSearchController {
@Resource
private KeywordSearchService keywordSearchService;
@PostMapping("/create")
@Operation(summary = "创建高德关键字搜索记录")
@PreAuthorize("@ss.hasPermission('map:keyword-search:create')")
public CommonResult<Long> createKeywordSearch(@Valid @RequestBody KeywordSearchSaveReqVO createReqVO) {
return success(keywordSearchService.createKeywordSearch(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新高德关键字搜索记录")
@PreAuthorize("@ss.hasPermission('map:keyword-search:update')")
public CommonResult<Boolean> updateKeywordSearch(@Valid @RequestBody KeywordSearchSaveReqVO updateReqVO) {
keywordSearchService.updateKeywordSearch(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除高德关键字搜索记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('map:keyword-search:delete')")
public CommonResult<Boolean> deleteKeywordSearch(@RequestParam("id") Long id) {
keywordSearchService.deleteKeywordSearch(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得高德关键字搜索记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<KeywordSearchRespVO> getKeywordSearch(@RequestParam("id") Long id) {
KeywordSearchDO keywordSearch = keywordSearchService.getKeywordSearch(id);
return success(BeanUtils.toBean(keywordSearch, KeywordSearchRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得高德关键字搜索记录分页")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PageResult<KeywordSearchRespVO>> getKeywordSearchPage(@Valid KeywordSearchPageReqVO pageReqVO) {
pageReqVO.setPageSize(25);
PageResult<KeywordSearchDO> pageResult = keywordSearchService.getKeywordSearchPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal()));
}
return success(BeanUtils.toBean(pageResult, KeywordSearchRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出高德关键字搜索记录 Excel")
@PreAuthorize("@ss.hasPermission('map:keyword-search:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportKeywordSearchExcel(@Valid KeywordSearchPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<KeywordSearchDO> list = keywordSearchService.getKeywordSearchPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "高德关键字搜索记录.xls", "数据", KeywordSearchRespVO.class,
BeanUtils.toBean(list, KeywordSearchRespVO.class));
}
// ==================== 子表商业信息 ====================
@GetMapping("/pois-business/get-by-key-search-id")
@Operation(summary = "获得商业信息")
@Parameter(name = "keySearchId", description = "搜索记录ID")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PoisBusinessDO> getPoisBusinessByKeySearchId(@RequestParam("keySearchId") Long keySearchId) {
return success(keywordSearchService.getPoisBusinessByKeySearchId(keySearchId));
}
// ==================== 子表室内信息 ====================
@GetMapping("/pois-indoor/get-by-key-search-id")
@Operation(summary = "获得室内信息")
@Parameter(name = "keySearchId", description = "搜索记录ID")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PoisIndoorDO> getPoisIndoorByKeySearchId(@RequestParam("keySearchId") Long keySearchId) {
return success(keywordSearchService.getPoisIndoorByKeySearchId(keySearchId));
}
// ==================== 子表导航信息 ====================
@GetMapping("/pois-navi/get-by-key-search-id")
@Operation(summary = "获得导航信息")
@Parameter(name = "keySearchId", description = "搜索记录ID")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PoisNaviDO> getPoisNaviByKeySearchId(@RequestParam("keySearchId") Long keySearchId) {
return success(keywordSearchService.getPoisNaviByKeySearchId(keySearchId));
}
// ==================== 子表图片信息 ====================
@GetMapping("/pois-photos/get-by-key-search-id")
@Operation(summary = "获得图片信息")
@Parameter(name = "keySearchId", description = "搜索记录ID")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PoisPhotosDO> getPoisPhotosByKeySearchId(@RequestParam("keySearchId") Long keySearchId) {
return success(keywordSearchService.getPoisPhotosByKeySearchId(keySearchId));
}
// ==================== 子表基础信息 ====================
@GetMapping("/pois/get-by-key-search-id")
@Operation(summary = "获得基础信息")
@Parameter(name = "keySearchId", description = "搜索记录ID")
@PreAuthorize("@ss.hasPermission('map:keyword-search:query')")
public CommonResult<PoisDO> getPoisByKeySearchId(@RequestParam("keySearchId") Long keySearchId) {
return success(keywordSearchService.getPoisByKeySearchId(keySearchId));
}
}

View File

@ -1,55 +0,0 @@
package cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 高德关键字搜索记录分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class KeywordSearchPageReqVO extends PageParam {
@Schema(description = "描述", example = "你说的对")
private String description;
@Schema(description = "状态1成功0失败", example = "2")
private String status;
@Schema(description = "状态描述")
private String info;
@Schema(description = "错误码")
private String infocode;
@Schema(description = "返回POI数量", example = "6432")
private Integer count;
@Schema(description = "搜索关键字")
private String keywords;
@Schema(description = "地点类型")
private String types;
@Schema(description = "搜索区域")
private String region;
@Schema(description = "城市限制0否1是")
private Boolean cityLimit;
@Schema(description = "每页大小",example = "25")
private Integer pageSize;
@Schema(description = "页码",example = "1")
private Integer pageNum;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -1,67 +0,0 @@
package cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 高德关键字搜索记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class KeywordSearchRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21756")
@ExcelProperty("编号")
private Long id;
@Schema(description = "描述", example = "你说的对")
@ExcelProperty("描述")
private String description;
@Schema(description = "状态1成功0失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("状态1成功0失败")
private String status;
@Schema(description = "状态描述", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("状态描述")
private String info;
@Schema(description = "错误码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("错误码")
private String infocode;
@Schema(description = "返回POI数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "6432")
@ExcelProperty("返回POI数量")
private Integer count;
@Schema(description = "搜索关键字", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("搜索关键字")
private String keywords;
@Schema(description = "地点类型")
@ExcelProperty("地点类型")
private String types;
@Schema(description = "搜索区域")
@ExcelProperty("搜索区域")
private String region;
@Schema(description = "城市限制0否1是")
@ExcelProperty("城市限制0否1是")
private Boolean cityLimit;
@Schema(description = "每页大小")
@ExcelProperty("每页大小")
private Integer pageSize;
@Schema(description = "页码")
@ExcelProperty("页码")
private Integer pageNum;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -1,73 +0,0 @@
package cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisIndoorDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisPhotosDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisDO;
@Schema(description = "管理后台 - 高德关键字搜索记录新增/修改 Request VO")
@Data
public class KeywordSearchSaveReqVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21756")
private Long id;
@Schema(description = "描述", example = "你说的对")
private String description;
@Schema(description = "状态1成功0失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "状态1成功0失败不能为空")
private String status;
@Schema(description = "状态描述", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "状态描述不能为空")
private String info;
@Schema(description = "错误码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "错误码不能为空")
private String infocode;
@Schema(description = "返回POI数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "6432")
@NotNull(message = "返回POI数量不能为空")
private Integer count;
@Schema(description = "搜索关键字", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "搜索关键字不能为空")
private String keywords;
@Schema(description = "地点类型")
private String types;
@Schema(description = "搜索区域")
private String region;
@Schema(description = "城市限制0否1是")
private Boolean cityLimit;
@Schema(description = "每页大小")
private Integer pageSize;
@Schema(description = "页码")
private Integer pageNum;
@Schema(description = "商业信息")
private PoisBusinessDO poisBusiness;
@Schema(description = "室内信息")
private PoisIndoorDO poisIndoor;
@Schema(description = "导航信息")
private PoisNaviDO poisNavi;
@Schema(description = "图片信息")
private PoisPhotosDO poisPhotos;
@Schema(description = "基础信息")
private PoisDO pois;
}

View File

@ -0,0 +1,128 @@
package cn.iocoder.yudao.module.map.controller.admin.pois;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.map.controller.admin.pois.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisPhotosDO;
import cn.iocoder.yudao.module.map.service.pois.PoisService;
@Tag(name = "管理后台 - 高德POI基础信息")
@RestController
@RequestMapping("/map/pois")
@Validated
public class PoisController {
@Resource
private PoisService poisService;
@PostMapping("/create")
@Operation(summary = "创建高德POI基础信息")
@PreAuthorize("@ss.hasPermission('map:pois:create')")
public CommonResult<Long> createPois(@Valid @RequestBody PoisSaveReqVO createReqVO) {
return success(poisService.createPois(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新高德POI基础信息")
@PreAuthorize("@ss.hasPermission('map:pois:update')")
public CommonResult<Boolean> updatePois(@Valid @RequestBody PoisSaveReqVO updateReqVO) {
poisService.updatePois(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除高德POI基础信息")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('map:pois:delete')")
public CommonResult<Boolean> deletePois(@RequestParam("id") Long id) {
poisService.deletePois(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得高德POI基础信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('map:pois:query')")
public CommonResult<PoisRespVO> getPois(@RequestParam("id") Long id) {
PoisDO pois = poisService.getPois(id);
return success(BeanUtils.toBean(pois, PoisRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得高德POI基础信息分页")
@PreAuthorize("@ss.hasPermission('map:pois:query')")
public CommonResult<PageResult<PoisRespVO>> getPoisPage(@Valid PoisPageReqVO pageReqVO) {
PageResult<PoisDO> pageResult = poisService.getPoisPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, PoisRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出高德POI基础信息 Excel")
@PreAuthorize("@ss.hasPermission('map:pois:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportPoisExcel(@Valid PoisPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<PoisDO> list = poisService.getPoisPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "高德POI基础信息.xls", "数据", PoisRespVO.class,
BeanUtils.toBean(list, PoisRespVO.class));
}
// ==================== 子表高德POI商业信息 ====================
@GetMapping("/pois-business/get-by-pois-id")
@Operation(summary = "获得高德POI商业信息")
@Parameter(name = "poisId", description = "pois表ID")
@PreAuthorize("@ss.hasPermission('map:pois:query')")
public CommonResult<PoisBusinessDO> getPoisBusinessByPoisId(@RequestParam("poisId") Long poisId) {
return success(poisService.getPoisBusinessByPoisId(poisId));
}
// ==================== 子表高德POI导航信息 ====================
@GetMapping("/pois-navi/get-by-pois-id")
@Operation(summary = "获得高德POI导航信息")
@Parameter(name = "poisId", description = "pois表ID")
@PreAuthorize("@ss.hasPermission('map:pois:query')")
public CommonResult<PoisNaviDO> getPoisNaviByPoisId(@RequestParam("poisId") Long poisId) {
return success(poisService.getPoisNaviByPoisId(poisId));
}
// ==================== 子表高德POI图片信息 ====================
@GetMapping("/pois-photos/get-by-pois-id")
@Operation(summary = "获得高德POI图片信息")
@Parameter(name = "poisId", description = "pois表ID")
@PreAuthorize("@ss.hasPermission('map:pois:query')")
public CommonResult<PoisPhotosDO> getPoisPhotosByPoisId(@RequestParam("poisId") Long poisId) {
return success(poisService.getPoisPhotosByPoisId(poisId));
}
}

View File

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.map.controller.admin.pois.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 高德POI基础信息分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PoisPageReqVO extends PageParam {
@Schema(description = "搜索记录ID", example = "1273")
private Long keySearchId;
@Schema(description = "POI名称", example = "王五")
private String name;
@Schema(description = "经纬度", example = "116.413232,39.899947")
private String location;
@Schema(description = "所属类型", example = "汽车服务;汽车养护/装饰;汽车养护|汽车服务;洗车场;洗车场|汽车维修;汽车维修;汽车维修")
private String type;
@Schema(description = "分类编码", example = "010400|010500|030000")
private String typecode;
@Schema(description = "省份", example = "北京市")
private String pname;
@Schema(description = "城市", example = "北京市")
private String cityName;
@Schema(description = "区县", example = "东城区")
private String adname;
@Schema(description = "详细地址", example = "宝鼎中心C座B2层(崇文门地铁站D西南口步行480米)")
private String address;
@Schema(description = "省份编码", example = "110000")
private String pcode;
@Schema(description = "区域编码", example = "110101")
private String adcode;
@Schema(description = "城市编码", example = "010")
private String citycode;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "poi唯一标识", example = "B0GUKCE3AI")
private String poiId;
}

View File

@ -0,0 +1,75 @@
package cn.iocoder.yudao.module.map.controller.admin.pois.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 高德POI基础信息 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PoisRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6687")
@ExcelProperty("主键")
private Long id;
@Schema(description = "搜索记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1273")
@ExcelProperty("搜索记录ID")
private Long keySearchId;
@Schema(description = "POI名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("POI名称")
private String name;
@Schema(description = "经纬度", requiredMode = Schema.RequiredMode.REQUIRED, example = "116.413232,39.899947")
@ExcelProperty("经纬度")
private String location;
@Schema(description = "所属类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "汽车服务;汽车养护/装饰;汽车养护|汽车服务;洗车场;洗车场|汽车维修;汽车维修;汽车维修")
@ExcelProperty("所属类型")
private String type;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "010400|010500|030000")
@ExcelProperty("分类编码")
private String typecode;
@Schema(description = "省份", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市")
@ExcelProperty("省份")
private String pname;
@Schema(description = "城市", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市")
@ExcelProperty("城市")
private String cityName;
@Schema(description = "区县", requiredMode = Schema.RequiredMode.REQUIRED, example = "东城区")
@ExcelProperty("区县")
private String adname;
@Schema(description = "详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "宝鼎中心C座B2层(崇文门地铁站D西南口步行480米)")
@ExcelProperty("详细地址")
private String address;
@Schema(description = "省份编码", example = "110000")
@ExcelProperty("省份编码")
private String pcode;
@Schema(description = "区域编码", example = "110101")
@ExcelProperty("区域编码")
private String adcode;
@Schema(description = "城市编码", example = "010")
@ExcelProperty("城市编码")
private String citycode;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "poi唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "B0GUKCE3AI")
@ExcelProperty("poi唯一标识")
private String poiId;
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.map.controller.admin.pois.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisPhotosDO;
@Schema(description = "管理后台 - 高德POI基础信息新增/修改 Request VO")
@Data
public class PoisSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6687")
private Long id;
@Schema(description = "搜索记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1273")
@NotNull(message = "搜索记录ID不能为空")
private Long keySearchId;
@Schema(description = "POI名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "POI名称不能为空")
private String name;
@Schema(description = "经纬度", requiredMode = Schema.RequiredMode.REQUIRED, example = "116.413232,39.899947")
@NotEmpty(message = "经纬度不能为空")
private String location;
@Schema(description = "所属类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "汽车服务;汽车养护/装饰;汽车养护|汽车服务;洗车场;洗车场|汽车维修;汽车维修;汽车维修")
@NotEmpty(message = "所属类型不能为空")
private String type;
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "010400|010500|030000")
@NotEmpty(message = "分类编码不能为空")
private String typecode;
@Schema(description = "省份", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市")
@NotEmpty(message = "省份不能为空")
private String pname;
@Schema(description = "城市", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市")
@NotEmpty(message = "城市不能为空")
private String cityName;
@Schema(description = "区县", requiredMode = Schema.RequiredMode.REQUIRED, example = "东城区")
@NotEmpty(message = "区县不能为空")
private String adname;
@Schema(description = "详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "宝鼎中心C座B2层(崇文门地铁站D西南口步行480米)")
@NotEmpty(message = "详细地址不能为空")
private String address;
@Schema(description = "省份编码", example = "110000")
private String pcode;
@Schema(description = "区域编码", example = "110101")
private String adcode;
@Schema(description = "城市编码", example = "010")
private String citycode;
@Schema(description = "poi唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "B0GUKCE3AI")
@NotEmpty(message = "poi唯一标识不能为空")
private String poiId;
@Schema(description = "高德POI商业信息")
private PoisBusinessDO poisBusiness;
@Schema(description = "高德POI导航信息")
private PoisNaviDO poisNavi;
@Schema(description = "高德POI图片信息")
private PoisPhotosDO poisPhotos;
}

View File

@ -1,75 +0,0 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 高德关键字搜索记录 DO
*
* @author AN
*/
@TableName("map_keyword_search")
@KeySequence("map_keyword_search_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KeywordSearchDO extends BaseDO {
/**
* 编号
*/
@TableId
private Long id;
/**
* 描述
*/
private String description;
/**
* 状态1成功0失败
*/
private String status;
/**
* 状态描述
*/
private String info;
/**
* 错误码
*/
private String infocode;
/**
* 返回POI数量
*/
private Integer count;
/**
* 搜索关键字
*/
private String keywords;
/**
* 地点类型
*/
private String types;
/**
* 搜索区域
*/
private String region;
/**
* 城市限制0否1是
*/
private Boolean cityLimit;
/**
* 每页大小
*/
private Integer pageSize;
/**
* 页码
*/
private Integer pageNum;
}

View File

@ -1,51 +0,0 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 室内信息 DO
*
* @author AN
*/
@TableName("map_pois_indoor")
@KeySequence("map_pois_indoor_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PoisIndoorDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 搜索记录ID
*/
private Long keySearchId;
/**
* 室内地图标志1有0无
*/
private Boolean indoorMap;
/**
* 如果当前 POI 为建筑物类 POI cpid 为自身 POI ID如果当前 POI 为商铺类 POI cpid 为其所在建筑物的 POI IDindoor_map 为0时不返回
*/
private String cpid;
/**
* 楼层索引一般会用数字表示例如8indoor_map 为0时不返回
*/
private String floor;
/**
* 实际楼层一般会带有字母例如F8indoor_map 为0时不返回
*/
private String truefloor;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
package cn.iocoder.yudao.module.map.dal.dataobject.pois;
import lombok.*;
import java.util.*;
@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 商业信息 DO
* 高德POI商业信息 DO
*
* @author AN
*/
@ -30,9 +30,9 @@ public class PoisBusinessDO extends BaseDO {
@TableId
private Long id;
/**
* 搜索记录ID
* pois表ID
*/
private Long keySearchId;
private Long poisId;
/**
* 所属商圈
*/

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
package cn.iocoder.yudao.module.map.dal.dataobject.pois;
import lombok.*;
import java.util.*;
@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 基础信息 DO
* 高德POI基础信息 DO
*
* @author 芋道源码
* @author
*/
@TableName("map_pois")
@KeySequence("map_pois_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@ -75,5 +75,9 @@ public class PoisDO extends BaseDO {
* 城市编码
*/
private String citycode;
/**
* poi唯一标识
*/
private String poiId;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
package cn.iocoder.yudao.module.map.dal.dataobject.pois;
import lombok.*;
import java.util.*;
@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 导航信息 DO
* 高德POI导航信息 DO
*
* @author AN
*/
@ -28,9 +28,9 @@ public class PoisNaviDO extends BaseDO {
@TableId
private Long id;
/**
* 搜索记录ID
* pois表ID
*/
private Long keySearchId;
private Long poisId;
/**
* 导航引导点坐标大型面状 POI 的导航引导点一般为各类出入口方便结合导航路线规划等服务使用
*/

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
package cn.iocoder.yudao.module.map.dal.dataobject.pois;
import lombok.*;
import java.util.*;
@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 图片信息 DO
* 高德POI图片信息 DO
*
* @author AN
*/
@ -28,9 +28,9 @@ public class PoisPhotosDO extends BaseDO {
@TableId
private Long id;
/**
* 搜索记录ID
* pois表ID
*/
private Long keySearchId;
private Long poisId;
/**
* 图片介绍
*/

View File

@ -1,37 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.KeywordSearchDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo.*;
/**
* 高德关键字搜索记录 Mapper
*
* @author AN
*/
@Mapper
public interface KeywordSearchMapper extends BaseMapperX<KeywordSearchDO> {
default PageResult<KeywordSearchDO> selectPage(KeywordSearchPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<KeywordSearchDO>()
.eqIfPresent(KeywordSearchDO::getDescription, reqVO.getDescription())
.eqIfPresent(KeywordSearchDO::getStatus, reqVO.getStatus())
.eqIfPresent(KeywordSearchDO::getInfo, reqVO.getInfo())
.eqIfPresent(KeywordSearchDO::getInfocode, reqVO.getInfocode())
.eqIfPresent(KeywordSearchDO::getCount, reqVO.getCount())
.likeIfPresent(KeywordSearchDO::getKeywords, reqVO.getKeywords())
.eqIfPresent(KeywordSearchDO::getTypes, reqVO.getTypes())
.eqIfPresent(KeywordSearchDO::getRegion, reqVO.getRegion())
.eqIfPresent(KeywordSearchDO::getCityLimit, reqVO.getCityLimit())
.eqIfPresent(KeywordSearchDO::getPageSize, reqVO.getPageSize())
.eqIfPresent(KeywordSearchDO::getPageNum, reqVO.getPageNum())
.betweenIfPresent(KeywordSearchDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(KeywordSearchDO::getId));
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisBusinessDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 商业信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisBusinessMapper extends BaseMapperX<PoisBusinessDO> {
default PoisBusinessDO selectByKeySearchId(Long keySearchId) {
return selectOne(PoisBusinessDO::getKeySearchId, keySearchId);
}
default int deleteByKeySearchId(Long keySearchId) {
return delete(PoisBusinessDO::getKeySearchId, keySearchId);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisIndoorDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 室内信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisIndoorMapper extends BaseMapperX<PoisIndoorDO> {
default PoisIndoorDO selectByKeySearchId(Long keySearchId) {
return selectOne(PoisIndoorDO::getKeySearchId, keySearchId);
}
default int deleteByKeySearchId(Long keySearchId) {
return delete(PoisIndoorDO::getKeySearchId, keySearchId);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 基础信息 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface PoisMapper extends BaseMapperX<PoisDO> {
default PoisDO selectByKeySearchId(Long keySearchId) {
return selectOne(PoisDO::getKeySearchId, keySearchId);
}
default int deleteByKeySearchId(Long keySearchId) {
return delete(PoisDO::getKeySearchId, keySearchId);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisNaviDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 导航信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisNaviMapper extends BaseMapperX<PoisNaviDO> {
default PoisNaviDO selectByKeySearchId(Long keySearchId) {
return selectOne(PoisNaviDO::getKeySearchId, keySearchId);
}
default int deleteByKeySearchId(Long keySearchId) {
return delete(PoisNaviDO::getKeySearchId, keySearchId);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.map.dal.mysql.keywordsearch;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisPhotosDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 图片信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisPhotosMapper extends BaseMapperX<PoisPhotosDO> {
default PoisPhotosDO selectByKeySearchId(Long keySearchId) {
return selectOne(PoisPhotosDO::getKeySearchId, keySearchId);
}
default int deleteByKeySearchId(Long keySearchId) {
return delete(PoisPhotosDO::getKeySearchId, keySearchId);
}
}

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.map.dal.mysql.pois;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisBusinessDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 高德POI商业信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisBusinessMapper extends BaseMapperX<PoisBusinessDO> {
default PoisBusinessDO selectByPoisId(Long poisId) {
return selectOne(PoisBusinessDO::getPoisId, poisId);
}
default int deleteByPoisId(Long poisId) {
return delete(PoisBusinessDO::getPoisId, poisId);
}
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.map.dal.mysql.pois;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.map.controller.admin.pois.vo.*;
/**
* 高德POI基础信息 Mapper
*
* @author
*/
@Mapper
public interface PoisMapper extends BaseMapperX<PoisDO> {
default PageResult<PoisDO> selectPage(PoisPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PoisDO>()
.eqIfPresent(PoisDO::getKeySearchId, reqVO.getKeySearchId())
.likeIfPresent(PoisDO::getName, reqVO.getName())
.eqIfPresent(PoisDO::getLocation, reqVO.getLocation())
.likeIfPresent(PoisDO::getType, reqVO.getType())
.likeIfPresent(PoisDO::getTypecode, reqVO.getTypecode())
.likeIfPresent(PoisDO::getPname, reqVO.getPname())
.likeIfPresent(PoisDO::getCityName, reqVO.getCityName())
.likeIfPresent(PoisDO::getAdname, reqVO.getAdname())
.eqIfPresent(PoisDO::getAddress, reqVO.getAddress())
.eqIfPresent(PoisDO::getPcode, reqVO.getPcode())
.eqIfPresent(PoisDO::getAdcode, reqVO.getAdcode())
.eqIfPresent(PoisDO::getCitycode, reqVO.getCitycode())
.betweenIfPresent(PoisDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(PoisDO::getPoiId, reqVO.getPoiId())
.orderByDesc(PoisDO::getId));
}
}

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.map.dal.mysql.pois;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisNaviDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 高德POI导航信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisNaviMapper extends BaseMapperX<PoisNaviDO> {
default PoisNaviDO selectByPoisId(Long poisId) {
return selectOne(PoisNaviDO::getPoisId, poisId);
}
default int deleteByPoisId(Long poisId) {
return delete(PoisNaviDO::getPoisId, poisId);
}
}

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.map.dal.mysql.pois;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisPhotosDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 高德POI图片信息 Mapper
*
* @author AN
*/
@Mapper
public interface PoisPhotosMapper extends BaseMapperX<PoisPhotosDO> {
default PoisPhotosDO selectByPoisId(Long poisId) {
return selectOne(PoisPhotosDO::getPoisId, poisId);
}
default int deleteByPoisId(Long poisId) {
return delete(PoisPhotosDO::getPoisId, poisId);
}
}

View File

@ -1,110 +0,0 @@
package cn.iocoder.yudao.module.map.service.keywordsearch;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.KeywordSearchDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisIndoorDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisPhotosDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 高德关键字搜索记录 Service 接口
*
* @author AN
*/
public interface KeywordSearchService {
/**
* 创建高德关键字搜索记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createKeywordSearch(@Valid KeywordSearchSaveReqVO createReqVO);
/**
* 更新高德关键字搜索记录
*
* @param updateReqVO 更新信息
*/
void updateKeywordSearch(@Valid KeywordSearchSaveReqVO updateReqVO);
/**
* 删除高德关键字搜索记录
*
* @param id 编号
*/
void deleteKeywordSearch(Long id);
/**
* 获得高德关键字搜索记录
*
* @param id 编号
* @return 高德关键字搜索记录
*/
KeywordSearchDO getKeywordSearch(Long id);
/**
* 获得高德关键字搜索记录分页
*
* @param pageReqVO 分页查询
* @return 高德关键字搜索记录分页
*/
PageResult<KeywordSearchDO> getKeywordSearchPage(KeywordSearchPageReqVO pageReqVO);
// ==================== 子表商业信息 ====================
/**
* 获得商业信息
*
* @param keySearchId 搜索记录ID
* @return 商业信息
*/
PoisBusinessDO getPoisBusinessByKeySearchId(Long keySearchId);
// ==================== 子表室内信息 ====================
/**
* 获得室内信息
*
* @param keySearchId 搜索记录ID
* @return 室内信息
*/
PoisIndoorDO getPoisIndoorByKeySearchId(Long keySearchId);
// ==================== 子表导航信息 ====================
/**
* 获得导航信息
*
* @param keySearchId 搜索记录ID
* @return 导航信息
*/
PoisNaviDO getPoisNaviByKeySearchId(Long keySearchId);
// ==================== 子表图片信息 ====================
/**
* 获得图片信息
*
* @param keySearchId 搜索记录ID
* @return 图片信息
*/
PoisPhotosDO getPoisPhotosByKeySearchId(Long keySearchId);
// ==================== 子表基础信息 ====================
/**
* 获得基础信息
*
* @param keySearchId 搜索记录ID
* @return 基础信息
*/
PoisDO getPoisByKeySearchId(Long keySearchId);
}

View File

@ -1,258 +0,0 @@
package cn.iocoder.yudao.module.map.service.keywordsearch;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.map.controller.admin.keywordsearch.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.KeywordSearchDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisIndoorDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisPhotosDO;
import cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch.PoisDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.KeywordSearchMapper;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.PoisBusinessMapper;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.PoisIndoorMapper;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.PoisNaviMapper;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.PoisPhotosMapper;
import cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.PoisMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.map.enums.ErrorCodeConstants.*;
/**
* 高德关键字搜索记录 Service 实现类
*
* @author AN
*/
@Service
@Validated
public class KeywordSearchServiceImpl implements KeywordSearchService {
@Resource
private KeywordSearchMapper keywordSearchMapper;
@Resource
private PoisBusinessMapper poisBusinessMapper;
@Resource
private PoisIndoorMapper poisIndoorMapper;
@Resource
private PoisNaviMapper poisNaviMapper;
@Resource
private PoisPhotosMapper poisPhotosMapper;
@Resource
private PoisMapper poisMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createKeywordSearch(KeywordSearchSaveReqVO createReqVO) {
// 插入
KeywordSearchDO keywordSearch = BeanUtils.toBean(createReqVO, KeywordSearchDO.class);
keywordSearchMapper.insert(keywordSearch);
// 插入子表
createPoisBusiness(keywordSearch.getId(), createReqVO.getPoisBusiness());
createPoisIndoor(keywordSearch.getId(), createReqVO.getPoisIndoor());
createPoisNavi(keywordSearch.getId(), createReqVO.getPoisNavi());
createPoisPhotos(keywordSearch.getId(), createReqVO.getPoisPhotos());
createPois(keywordSearch.getId(), createReqVO.getPois());
// 返回
return keywordSearch.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateKeywordSearch(KeywordSearchSaveReqVO updateReqVO) {
// 校验存在
validateKeywordSearchExists(updateReqVO.getId());
// 更新
KeywordSearchDO updateObj = BeanUtils.toBean(updateReqVO, KeywordSearchDO.class);
keywordSearchMapper.updateById(updateObj);
// 更新子表
updatePoisBusiness(updateReqVO.getId(), updateReqVO.getPoisBusiness());
updatePoisIndoor(updateReqVO.getId(), updateReqVO.getPoisIndoor());
updatePoisNavi(updateReqVO.getId(), updateReqVO.getPoisNavi());
updatePoisPhotos(updateReqVO.getId(), updateReqVO.getPoisPhotos());
updatePois(updateReqVO.getId(), updateReqVO.getPois());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteKeywordSearch(Long id) {
// 校验存在
validateKeywordSearchExists(id);
// 删除
keywordSearchMapper.deleteById(id);
// 删除子表
deletePoisBusinessByKeySearchId(id);
deletePoisIndoorByKeySearchId(id);
deletePoisNaviByKeySearchId(id);
deletePoisPhotosByKeySearchId(id);
deletePoisByKeySearchId(id);
}
private void validateKeywordSearchExists(Long id) {
if (keywordSearchMapper.selectById(id) == null) {
throw exception(KEYWORD_SEARCH_NOT_EXISTS);
}
}
@Override
public KeywordSearchDO getKeywordSearch(Long id) {
return keywordSearchMapper.selectById(id);
}
@Override
public PageResult<KeywordSearchDO> getKeywordSearchPage(KeywordSearchPageReqVO pageReqVO) {
return keywordSearchMapper.selectPage(pageReqVO);
}
// ==================== 子表商业信息 ====================
@Override
public PoisBusinessDO getPoisBusinessByKeySearchId(Long keySearchId) {
return poisBusinessMapper.selectByKeySearchId(keySearchId);
}
private void createPoisBusiness(Long keySearchId, PoisBusinessDO poisBusiness) {
if (poisBusiness == null) {
return;
}
poisBusiness.setKeySearchId(keySearchId);
poisBusinessMapper.insert(poisBusiness);
}
private void updatePoisBusiness(Long keySearchId, PoisBusinessDO poisBusiness) {
if (poisBusiness == null) {
return;
}
poisBusiness.setKeySearchId(keySearchId);
poisBusiness.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisBusinessMapper.insertOrUpdate(poisBusiness);
}
private void deletePoisBusinessByKeySearchId(Long keySearchId) {
poisBusinessMapper.deleteByKeySearchId(keySearchId);
}
// ==================== 子表室内信息 ====================
@Override
public PoisIndoorDO getPoisIndoorByKeySearchId(Long keySearchId) {
return poisIndoorMapper.selectByKeySearchId(keySearchId);
}
private void createPoisIndoor(Long keySearchId, PoisIndoorDO poisIndoor) {
if (poisIndoor == null) {
return;
}
poisIndoor.setKeySearchId(keySearchId);
poisIndoorMapper.insert(poisIndoor);
}
private void updatePoisIndoor(Long keySearchId, PoisIndoorDO poisIndoor) {
if (poisIndoor == null) {
return;
}
poisIndoor.setKeySearchId(keySearchId);
poisIndoor.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisIndoorMapper.insertOrUpdate(poisIndoor);
}
private void deletePoisIndoorByKeySearchId(Long keySearchId) {
poisIndoorMapper.deleteByKeySearchId(keySearchId);
}
// ==================== 子表导航信息 ====================
@Override
public PoisNaviDO getPoisNaviByKeySearchId(Long keySearchId) {
return poisNaviMapper.selectByKeySearchId(keySearchId);
}
private void createPoisNavi(Long keySearchId, PoisNaviDO poisNavi) {
if (poisNavi == null) {
return;
}
poisNavi.setKeySearchId(keySearchId);
poisNaviMapper.insert(poisNavi);
}
private void updatePoisNavi(Long keySearchId, PoisNaviDO poisNavi) {
if (poisNavi == null) {
return;
}
poisNavi.setKeySearchId(keySearchId);
poisNavi.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisNaviMapper.insertOrUpdate(poisNavi);
}
private void deletePoisNaviByKeySearchId(Long keySearchId) {
poisNaviMapper.deleteByKeySearchId(keySearchId);
}
// ==================== 子表图片信息 ====================
@Override
public PoisPhotosDO getPoisPhotosByKeySearchId(Long keySearchId) {
return poisPhotosMapper.selectByKeySearchId(keySearchId);
}
private void createPoisPhotos(Long keySearchId, PoisPhotosDO poisPhotos) {
if (poisPhotos == null) {
return;
}
poisPhotos.setKeySearchId(keySearchId);
poisPhotosMapper.insert(poisPhotos);
}
private void updatePoisPhotos(Long keySearchId, PoisPhotosDO poisPhotos) {
if (poisPhotos == null) {
return;
}
poisPhotos.setKeySearchId(keySearchId);
poisPhotos.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisPhotosMapper.insertOrUpdate(poisPhotos);
}
private void deletePoisPhotosByKeySearchId(Long keySearchId) {
poisPhotosMapper.deleteByKeySearchId(keySearchId);
}
// ==================== 子表基础信息 ====================
@Override
public PoisDO getPoisByKeySearchId(Long keySearchId) {
return poisMapper.selectByKeySearchId(keySearchId);
}
private void createPois(Long keySearchId, PoisDO pois) {
if (pois == null) {
return;
}
pois.setKeySearchId(keySearchId);
poisMapper.insert(pois);
}
private void updatePois(Long keySearchId, PoisDO pois) {
if (pois == null) {
return;
}
pois.setKeySearchId(keySearchId);
pois.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisMapper.insertOrUpdate(pois);
}
private void deletePoisByKeySearchId(Long keySearchId) {
poisMapper.deleteByKeySearchId(keySearchId);
}
}

View File

@ -0,0 +1,88 @@
package cn.iocoder.yudao.module.map.service.pois;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.map.controller.admin.pois.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisPhotosDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 高德POI基础信息 Service 接口
*
* @author
*/
public interface PoisService {
/**
* 创建高德POI基础信息
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createPois(@Valid PoisSaveReqVO createReqVO);
/**
* 更新高德POI基础信息
*
* @param updateReqVO 更新信息
*/
void updatePois(@Valid PoisSaveReqVO updateReqVO);
/**
* 删除高德POI基础信息
*
* @param id 编号
*/
void deletePois(Long id);
/**
* 获得高德POI基础信息
*
* @param id 编号
* @return 高德POI基础信息
*/
PoisDO getPois(Long id);
/**
* 获得高德POI基础信息分页
*
* @param pageReqVO 分页查询
* @return 高德POI基础信息分页
*/
PageResult<PoisDO> getPoisPage(PoisPageReqVO pageReqVO);
// ==================== 子表高德POI商业信息 ====================
/**
* 获得高德POI商业信息
*
* @param poisId pois表ID
* @return 高德POI商业信息
*/
PoisBusinessDO getPoisBusinessByPoisId(Long poisId);
// ==================== 子表高德POI导航信息 ====================
/**
* 获得高德POI导航信息
*
* @param poisId pois表ID
* @return 高德POI导航信息
*/
PoisNaviDO getPoisNaviByPoisId(Long poisId);
// ==================== 子表高德POI图片信息 ====================
/**
* 获得高德POI图片信息
*
* @param poisId pois表ID
* @return 高德POI图片信息
*/
PoisPhotosDO getPoisPhotosByPoisId(Long poisId);
}

View File

@ -0,0 +1,188 @@
package cn.iocoder.yudao.module.map.service.pois;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.map.controller.admin.pois.vo.*;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisBusinessDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisNaviDO;
import cn.iocoder.yudao.module.map.dal.dataobject.pois.PoisPhotosDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.map.dal.mysql.pois.PoisMapper;
import cn.iocoder.yudao.module.map.dal.mysql.pois.PoisBusinessMapper;
import cn.iocoder.yudao.module.map.dal.mysql.pois.PoisNaviMapper;
import cn.iocoder.yudao.module.map.dal.mysql.pois.PoisPhotosMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.map.enums.ErrorCodeConstants.*;
/**
* 高德POI基础信息 Service 实现类
*
* @author
*/
@Service
@Validated
public class PoisServiceImpl implements PoisService {
@Resource
private PoisMapper poisMapper;
@Resource
private PoisBusinessMapper poisBusinessMapper;
@Resource
private PoisNaviMapper poisNaviMapper;
@Resource
private PoisPhotosMapper poisPhotosMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createPois(PoisSaveReqVO createReqVO) {
// 插入
PoisDO pois = BeanUtils.toBean(createReqVO, PoisDO.class);
poisMapper.insert(pois);
// 插入子表
createPoisBusiness(pois.getId(), createReqVO.getPoisBusiness());
createPoisNavi(pois.getId(), createReqVO.getPoisNavi());
createPoisPhotos(pois.getId(), createReqVO.getPoisPhotos());
// 返回
return pois.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updatePois(PoisSaveReqVO updateReqVO) {
// 校验存在
validatePoisExists(updateReqVO.getId());
// 更新
PoisDO updateObj = BeanUtils.toBean(updateReqVO, PoisDO.class);
poisMapper.updateById(updateObj);
// 更新子表
updatePoisBusiness(updateReqVO.getId(), updateReqVO.getPoisBusiness());
updatePoisNavi(updateReqVO.getId(), updateReqVO.getPoisNavi());
updatePoisPhotos(updateReqVO.getId(), updateReqVO.getPoisPhotos());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deletePois(Long id) {
// 校验存在
validatePoisExists(id);
// 删除
poisMapper.deleteById(id);
// 删除子表
deletePoisBusinessByPoisId(id);
deletePoisNaviByPoisId(id);
deletePoisPhotosByPoisId(id);
}
private void validatePoisExists(Long id) {
if (poisMapper.selectById(id) == null) {
throw exception(POIS_NOT_EXISTS);
}
}
@Override
public PoisDO getPois(Long id) {
return poisMapper.selectById(id);
}
@Override
public PageResult<PoisDO> getPoisPage(PoisPageReqVO pageReqVO) {
return poisMapper.selectPage(pageReqVO);
}
// ==================== 子表高德POI商业信息 ====================
@Override
public PoisBusinessDO getPoisBusinessByPoisId(Long poisId) {
return poisBusinessMapper.selectByPoisId(poisId);
}
private void createPoisBusiness(Long poisId, PoisBusinessDO poisBusiness) {
if (poisBusiness == null) {
return;
}
poisBusiness.setPoisId(poisId);
poisBusinessMapper.insert(poisBusiness);
}
private void updatePoisBusiness(Long poisId, PoisBusinessDO poisBusiness) {
if (poisBusiness == null) {
return;
}
poisBusiness.setPoisId(poisId);
poisBusiness.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisBusinessMapper.insertOrUpdate(poisBusiness);
}
private void deletePoisBusinessByPoisId(Long poisId) {
poisBusinessMapper.deleteByPoisId(poisId);
}
// ==================== 子表高德POI导航信息 ====================
@Override
public PoisNaviDO getPoisNaviByPoisId(Long poisId) {
return poisNaviMapper.selectByPoisId(poisId);
}
private void createPoisNavi(Long poisId, PoisNaviDO poisNavi) {
if (poisNavi == null) {
return;
}
poisNavi.setPoisId(poisId);
poisNaviMapper.insert(poisNavi);
}
private void updatePoisNavi(Long poisId, PoisNaviDO poisNavi) {
if (poisNavi == null) {
return;
}
poisNavi.setPoisId(poisId);
poisNavi.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisNaviMapper.insertOrUpdate(poisNavi);
}
private void deletePoisNaviByPoisId(Long poisId) {
poisNaviMapper.deleteByPoisId(poisId);
}
// ==================== 子表高德POI图片信息 ====================
@Override
public PoisPhotosDO getPoisPhotosByPoisId(Long poisId) {
return poisPhotosMapper.selectByPoisId(poisId);
}
private void createPoisPhotos(Long poisId, PoisPhotosDO poisPhotos) {
if (poisPhotos == null) {
return;
}
poisPhotos.setPoisId(poisId);
poisPhotosMapper.insert(poisPhotos);
}
private void updatePoisPhotos(Long poisId, PoisPhotosDO poisPhotos) {
if (poisPhotos == null) {
return;
}
poisPhotos.setPoisId(poisId);
poisPhotos.setUpdater(null).setUpdateTime(null); // 解决更新情况下updateTime 不更新
poisPhotosMapper.insertOrUpdate(poisPhotos);
}
private void deletePoisPhotosByPoisId(Long poisId) {
poisPhotosMapper.deleteByPoisId(poisId);
}
}

View File

@ -1,6 +1,6 @@
<?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="cn.iocoder.yudao.module.map.dal.mysql.keywordsearch.KeywordSearchMapper">
<mapper namespace="cn.iocoder.yudao.module.map.dal.mysql.pois.PoisMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。