1.添加高德返回数据对应的POI表
This commit is contained in:
parent
8169e1525d
commit
014b42aad2
3
pom.xml
3
pom.xml
|
@ -22,7 +22,8 @@
|
|||
<!-- <module>yudao-module-pay</module>-->
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<module>yudao-module-crm</module>
|
||||
<!-- <module>yudao-module-erp</module>-->
|
||||
<module>yudao-module-map</module>
|
||||
<!-- <module>yudao-module-erp</module>-->
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
<!-- <module>yudao-module-iot</module>-->
|
||||
</modules>
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modules>
|
||||
<module>yudao-module-map-api</module>
|
||||
<module>yudao-module-map-biz</module>
|
||||
</modules>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-module-map</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
map 模块,主要实现 高德接口查询,获取poi类型数据,高德接口请求 等功能。
|
||||
</description>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-map</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-map-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
map 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
package cn.iocoder.yudao.module.map.enums;
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 高德关键字搜索记录 1-050-000-000 ==========
|
||||
// ========== 高德关键字搜索记录 TODO 补充编号 ==========
|
||||
ErrorCode KEYWORD_SEARCH_NOT_EXISTS = new ErrorCode(1_050_000_000, "高德关键字搜索记录不存在");
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-map</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>yudao-module-map-biz</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
map 模块,主要实现 XXX、YYY、ZZZ 等功能。
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-map-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,155 @@
|
|||
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));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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;
|
||||
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package cn.iocoder.yudao.module.map.dal.dataobject.keywordsearch;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
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_business")
|
||||
@KeySequence("map_pois_business_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PoisBusinessDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 搜索记录ID
|
||||
*/
|
||||
private Long keySearchId;
|
||||
/**
|
||||
* 所属商圈
|
||||
*/
|
||||
private String businessArea;
|
||||
/**
|
||||
* 今日营业时间
|
||||
*/
|
||||
private String opentimeToday;
|
||||
/**
|
||||
* 营业时间描述
|
||||
*/
|
||||
private String opentimeWeek;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String tel;
|
||||
/**
|
||||
* 特色内容,目前仅在美食poi下返回
|
||||
*/
|
||||
private String tag;
|
||||
/**
|
||||
* 评分,目前仅在餐饮、酒店、景点、影院类 POI 下返回
|
||||
*/
|
||||
private BigDecimal rating;
|
||||
/**
|
||||
* 人均消费,目前仅在餐饮、酒店、景点、影院类 POI 下返回
|
||||
*/
|
||||
private BigDecimal cost;
|
||||
/**
|
||||
* 停车场类型,目前仅在停车场类 POI 下返回
|
||||
*/
|
||||
private String parkingType;
|
||||
/**
|
||||
* 别名,无别名时不返回
|
||||
*/
|
||||
private String alias;
|
||||
/**
|
||||
* poi 标识,用于确认poi信息类型
|
||||
*/
|
||||
private String keytag;
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
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 芋道源码
|
||||
*/
|
||||
@TableName("map_pois")
|
||||
@KeySequence("map_pois_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PoisDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 搜索记录ID
|
||||
*/
|
||||
private Long keySearchId;
|
||||
/**
|
||||
* POI名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 经纬度
|
||||
*/
|
||||
private String location;
|
||||
/**
|
||||
* 所属类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
private String typecode;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String pname;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String cityName;
|
||||
/**
|
||||
* 区县
|
||||
*/
|
||||
private String adname;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String pcode;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String adcode;
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String citycode;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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 ID。indoor_map 为0时不返回
|
||||
*/
|
||||
private String cpid;
|
||||
/**
|
||||
* 楼层索引,一般会用数字表示,例如8;indoor_map 为0时不返回
|
||||
*/
|
||||
private String floor;
|
||||
/**
|
||||
* 实际楼层,一般会带有字母,例如F8;indoor_map 为0时不返回
|
||||
*/
|
||||
private String truefloor;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
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_navi")
|
||||
@KeySequence("map_pois_navi_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PoisNaviDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 搜索记录ID
|
||||
*/
|
||||
private Long keySearchId;
|
||||
/**
|
||||
* 导航引导点坐标。大型面状 POI 的导航引导点,一般为各类出入口,方便结合导航、路线规划等服务使用
|
||||
*/
|
||||
private String naviPoiid;
|
||||
/**
|
||||
* 入口经纬度坐标
|
||||
*/
|
||||
private String entrLocation;
|
||||
/**
|
||||
* 出口经纬度坐标
|
||||
*/
|
||||
private String exitLocation;
|
||||
/**
|
||||
* 地理格ID
|
||||
*/
|
||||
private String gridcode;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
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_photos")
|
||||
@KeySequence("map_pois_photos_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PoisPhotosDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 搜索记录ID
|
||||
*/
|
||||
private Long keySearchId;
|
||||
/**
|
||||
* 图片介绍
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
private String url;
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
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));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
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);
|
||||
|
||||
}
|
|
@ -0,0 +1,258 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?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 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -94,6 +94,13 @@
|
|||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MAP 相关模块。默认注释,保证编译速度 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-map-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ERP 相关模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
|
|
|
@ -20,6 +20,11 @@ public class DefaultController {
|
|||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[工作流模块 yudao-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]");
|
||||
}
|
||||
@RequestMapping("/admin-api/map/**")
|
||||
public CommonResult<Boolean> map404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[高德地图模块 yudao-module-map - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping("/admin-api/mp/**")
|
||||
public CommonResult<Boolean> mp404() {
|
||||
|
|
|
@ -178,6 +178,7 @@ logging:
|
|||
cn.iocoder.yudao.module.erp.dal.mysql: debug
|
||||
cn.iocoder.yudao.module.iot.dal.mysql: debug
|
||||
cn.iocoder.yudao.module.ai.dal.mysql: debug
|
||||
cn.iocoder.yudao.module.map.dal.mysql: debug
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
|
||||
|
||||
debug: false
|
||||
|
|
Loading…
Reference in New Issue