文旅相关逻辑集成
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?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>tourism-center</artifactId>
|
||||
<groupId>com.zlt</groupId>
|
||||
<version>6.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>tourism-service</artifactId>
|
||||
<name>tourism-service</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
||||
<properties>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zlt</groupId>
|
||||
<artifactId>tourism-core</artifactId>
|
||||
<version>6.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
|
||||
<imageTags>
|
||||
<imageTag>2023091902</imageTag>
|
||||
</imageTags>
|
||||
<forceTags>true</forceTags>
|
||||
<!-- <dockerHost>${docker.host}</dockerHost>-->
|
||||
<!-- <baseImage>${docker.baseImage}</baseImage>-->
|
||||
<!-- <volumes>${docker.volumes}</volumes>-->
|
||||
<!--<env>
|
||||
<JAVA_OPTS>${docker.java.opts}</JAVA_OPTS>
|
||||
</env>-->
|
||||
<entryPoint>["sh","-c","java $JAVA_OPTS ${docker.java.security.egd} -jar /${project.build.finalName}.jar"]</entryPoint>
|
||||
<!--是否推送到docker私有仓库-->
|
||||
<!-- <pushImage>true</pushImage>
|
||||
<registryUrl>https://hub.ikingtec.com:5000</registryUrl>-->
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}-release</finalName>
|
||||
</build>
|
||||
</project>
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.zlt.tourism;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.central.common.lb.annotation.EnableBaseFeignInterceptor;
|
||||
import com.central.common.lb.annotation.EnableFeignInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fucj
|
||||
* @doc 文旅服务启动类
|
||||
*/
|
||||
@EnableFeignClients(basePackages = {"com.central", "com.zlt"})
|
||||
@EnableFeignInterceptor
|
||||
@EnableBaseFeignInterceptor
|
||||
@EnableDiscoveryClient
|
||||
@Slf4j
|
||||
@EnableAsync
|
||||
@SpringBootApplication(scanBasePackages = {"com.zlt.tourism"}, exclude = DruidDataSourceAutoConfigure.class)
|
||||
public class CulturalTourismApplication extends SpringBootServletInitializer implements ApplicationRunner {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication app = new SpringApplication(new Class[]{CulturalTourismApplication.class});
|
||||
Environment env = app.run(args).getEnvironment();
|
||||
String protocol = "http";
|
||||
if (env.getProperty("server.ssl.key-store") != null) {
|
||||
protocol = "https";
|
||||
}
|
||||
|
||||
String contextPath = "";
|
||||
if (env.getProperty("server.servlet.context-path") != null) {
|
||||
contextPath = env.getProperty("server.servlet.context-path");
|
||||
}
|
||||
|
||||
log.info("\n----------------------------------------------------------\n\tCulturalTourismApplication '{}' is running! Access URLs:\n\tLocal: \t\t{}://localhost:{}{}\n\tExternal: \t{}://{}:{}{}\n\tProfile(s): \t{}\n----------------------------------------------------------", new Object[]{env.getProperty("spring.application.name"), protocol, env.getProperty("server.port"), contextPath, protocol, InetAddress.getLocalHost().getHostAddress(), env.getProperty("server.port"), contextPath, env.getActiveProfiles()});
|
||||
String configServerStatus = env.getProperty("configserver.status");
|
||||
log.info("\n----------------------------------------------------------\n\tConfig Server: \t{}\n----------------------------------------------------------", configServerStatus == null ? "Not found or not setup for this application" : configServerStatus);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
return builder.sources(CulturalTourismApplication.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args){
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpMessageConverters fastJsonHttpMessageConverters() {
|
||||
// 1. 需要定义一个converter转换消息的对象
|
||||
FastJsonHttpMessageConverter fasHttpMessageConverter =
|
||||
new FastJsonHttpMessageConverter();
|
||||
|
||||
// 2. 添加fastjson的配置信息,比如:是否需要格式化返回的json的数据
|
||||
FastJsonConfig fastJsonConfig = new FastJsonConfig();
|
||||
fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat, SerializerFeature.DisableCircularReferenceDetect);
|
||||
|
||||
// 3. 在converter中添加配置信息
|
||||
fasHttpMessageConverter.setFastJsonConfig(fastJsonConfig);
|
||||
HttpMessageConverter<?> converter = fasHttpMessageConverter;
|
||||
//解决中文乱码
|
||||
List<MediaType> fastMediaTypes = new ArrayList<>();
|
||||
fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
|
||||
fasHttpMessageConverter.setSupportedMediaTypes(fastMediaTypes);
|
||||
|
||||
return new HttpMessageConverters(converter);
|
||||
}
|
||||
}
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.*;
|
||||
import com.zlt.tourism.manager.BiaxVideoManager;
|
||||
import com.zlt.tourism.model.tourism.ScenicSpotEntity;
|
||||
import com.zlt.tourism.service.ScenicSpotService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.BiaxVideoPageVO;
|
||||
import com.zlt.tourism.vo.BiaxVideoVO;
|
||||
import com.zlt.tourism.vo.ValidScenicSpotVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 双轴视频控制器
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频控制器
|
||||
* @create 2024/7/18 16:13
|
||||
**/
|
||||
@Tag(name = "双轴视频管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/biax/video/")
|
||||
public class BiaxVideoController {
|
||||
|
||||
/**
|
||||
* 双轴视频业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoManager biaxVideoManager;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody BiaxVideoAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = biaxVideoManager.add(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增基础信息和上轴标记点")
|
||||
@PostMapping(value = "addBasicInfo", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result addBasicInfo(@Valid @RequestBody BiaxVideoBasicAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = biaxVideoManager.addBasicInfo(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增下轴标记点
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增下轴标记点")
|
||||
@PostMapping(value = "addDownTag", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result addDownTag(@Valid @RequestBody BiaxVideoDownTagListAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = biaxVideoManager.addDownTag(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑基础信息
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "编辑基础信息和上轴标记点")
|
||||
@PutMapping(value = "updateBasicInfo", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result updateBasicInfo(@Valid @RequestBody BiaxVideoBasicUpdateDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = biaxVideoManager.updateBasicInfo(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "编辑")
|
||||
@PutMapping(value = "update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result update(@Valid @RequestBody BiaxVideoUpdateDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = biaxVideoManager.update(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<BiaxVideoPageVO>> findPageList(@RequestBody BiaxVideoPageQuery query) {
|
||||
PageInfo<BiaxVideoPageVO> pageList = biaxVideoManager.selectPageList(query);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
try {
|
||||
Result result = biaxVideoManager.delete(id);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取实体
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据主键ID获取实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<BiaxVideoVO> getEntity(@PathVariable("id") Long id) {
|
||||
BiaxVideoVO model = biaxVideoManager.getEntity(id);
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证景点是否已绑定双轴视频
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "validExist", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<ValidScenicSpotVO> validExist(@NotNull(message = "景点ID不能为空") Long scenicSpotId, Long biaxVideoId){
|
||||
ValidScenicSpotVO model = new ValidScenicSpotVO();
|
||||
boolean existScenicSpot = biaxVideoManager.existScenicSpot(scenicSpotId, biaxVideoId);
|
||||
if(existScenicSpot){
|
||||
ScenicSpotEntity scenicSpotEntity = scenicSpotService.getById(scenicSpotId);
|
||||
if(scenicSpotEntity != null && StrUtil.isNotEmpty(scenicSpotEntity.getScenicSpotName())){
|
||||
model.setMsg("是否更新" + scenicSpotEntity.getScenicSpotName() + "下的双轴视频");
|
||||
}else{
|
||||
return Result.failed("景点不存在!");
|
||||
}
|
||||
model.setStatus(-2);
|
||||
}else{
|
||||
model.setStatus(1);
|
||||
}
|
||||
return Result.succeed(model);
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.zlt.tourism.dto.BiaxVideoFeatureTagAddDTO;
|
||||
import com.zlt.tourism.model.tourism.BiaxVideoFeatureTagEntity;
|
||||
import com.zlt.tourism.service.BiaxVideoFeatureTagService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 双轴视频特色景观标签接口类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频特色景观标签接口类
|
||||
* @create 2024/7/24 14:53
|
||||
**/
|
||||
@Tag(name = "双轴视频特色景观标签管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/biax/video/feature/tag/")
|
||||
public class BiaxVideoFeatureTagController {
|
||||
|
||||
/**
|
||||
* 双轴视频特色景观标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoFeatureTagService featureTagService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody BiaxVideoFeatureTagAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
BiaxVideoFeatureTagEntity entity = new BiaxVideoFeatureTagEntity();
|
||||
BeanUtil.copyProperties(model, entity);
|
||||
boolean existRecord = featureTagService.existRecord(entity);
|
||||
if(existRecord){
|
||||
return Result.failed("该关系已存在,操作失败!");
|
||||
}
|
||||
boolean addResult = featureTagService.save(entity);
|
||||
return addResult ? Result.succeed("新增成功") : Result.failed("新增失败");
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = featureTagService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.zlt.tourism.core.StationResult;
|
||||
import com.zlt.tourism.dto.device.DeviceListQuery;
|
||||
import com.zlt.tourism.dto.org.OrganizationQuery;
|
||||
import com.zlt.tourism.enums.DockTypeEnum;
|
||||
import com.zlt.tourism.feign.StationAdminService;
|
||||
import com.zlt.tourism.feign.StationWebService;
|
||||
import com.zlt.tourism.model.iking.IkDeviceEntity;
|
||||
import com.zlt.tourism.service.IkDeviceService;
|
||||
import com.zlt.tourism.vo.DeviceBasicVO;
|
||||
import com.zlt.tourism.vo.DeviceVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备控制器
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 设备控制器
|
||||
* @create 2024/7/4 14:37
|
||||
**/
|
||||
@Tag(name = "设备管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/device/")
|
||||
public class DeviceController {
|
||||
|
||||
/**
|
||||
* Station-Web远程调用业务类
|
||||
*/
|
||||
@Autowired
|
||||
private StationWebService stationWebService;
|
||||
|
||||
/**
|
||||
* Station-admin远程调用业务类
|
||||
*/
|
||||
@Autowired
|
||||
private StationAdminService stationAdminService;
|
||||
|
||||
/**
|
||||
* 设备业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkDeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 获取设备列表
|
||||
*
|
||||
* @param version 版本号
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "查询指定范围内的设备")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "version", value = "版本号", required = true, paramType = "query")
|
||||
// })
|
||||
@GetMapping("query")
|
||||
public StationResult queryDevice(@NotBlank(message = "版本号不能为空") String version) {
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
DeviceListQuery query = new DeviceListQuery();
|
||||
query.setVersion(version);
|
||||
query.setChannel(1);
|
||||
query.setIndustryType(10);
|
||||
StationResult result = stationWebService.queryDevice(query);
|
||||
return result;
|
||||
} else {
|
||||
return StationResult.error("获取当前用户失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取设备树形列表")
|
||||
@GetMapping("treeList")
|
||||
public StationResult getTreeList() {
|
||||
SysUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
OrganizationQuery query = new OrganizationQuery();
|
||||
query.setVersion("1.1");
|
||||
query.setChannel(1);
|
||||
query.setIndustryType(10);
|
||||
StationResult result = stationWebService.getOrganizationList(query);
|
||||
return result;
|
||||
} else {
|
||||
return StationResult.error("获取当前用户失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取实体
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据主键获取实体")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
})
|
||||
@GetMapping(value = "get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<DeviceVO> getEntity(@PathVariable("id") Long id) {
|
||||
DeviceVO model = new DeviceVO();
|
||||
StationResult result = stationAdminService.getDeviceById(id);
|
||||
if (result != null && 0 == result.getFlag() && result.get("data") != null) {
|
||||
if (result.containsKey("data") && result.get("data") != null) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.get("data").toString());
|
||||
if (jsonObject != null && jsonObject.containsKey("id")) {
|
||||
model.setId(jsonObject.getLong("id"));
|
||||
if (jsonObject.containsKey("deviceSn")) {
|
||||
model.setDeviceSn(jsonObject.getString("deviceSn"));
|
||||
}
|
||||
if (jsonObject.containsKey("cmdVersion")) {
|
||||
model.setCmdVersion(jsonObject.getInteger("cmdVersion"));
|
||||
}
|
||||
if (jsonObject.containsKey("deviceName")) {
|
||||
model.setDeviceName(jsonObject.getString("deviceName"));
|
||||
}
|
||||
if (jsonObject.containsKey("deviceType")) {
|
||||
model.setDeviceType(jsonObject.getInteger("deviceType"));
|
||||
}
|
||||
if (jsonObject.containsKey("longitude")) {
|
||||
model.setLongitude(jsonObject.getBigDecimal("longitude"));
|
||||
}
|
||||
if (jsonObject.containsKey("latitude")) {
|
||||
model.setLatitude(jsonObject.getBigDecimal("latitude"));
|
||||
}
|
||||
if (jsonObject.containsKey("altitude")) {
|
||||
model.setAltitude(jsonObject.getBigDecimal("altitude"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备列表
|
||||
* @param organizationId 机构ID
|
||||
* @param deviceTypes 设备类型,多个逗号分隔
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取机库列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "organizationId", value = "机构ID", required = false, paramType = "query"),
|
||||
@ApiImplicitParam(name = "deviceTypes", value = "设备类型,多个逗号分隔", required = false, paramType = "query")
|
||||
})
|
||||
@GetMapping("dock/list")
|
||||
public Result<List<DeviceBasicVO>> queryDevice(Long organizationId, String deviceTypes) {
|
||||
SysUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
List<DeviceBasicVO> list = new ArrayList<>();
|
||||
if(organizationId == null && user.getOrganizationId() != null){
|
||||
organizationId = user.getOrganizationId();
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("deleted", 0);
|
||||
if(organizationId != null){
|
||||
map.put("organizationId", organizationId);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(deviceTypes)){
|
||||
List<Integer> deviceTypeList = new ArrayList<>();
|
||||
String[] strDeviceTypes = deviceTypes.split(",");
|
||||
if(strDeviceTypes != null && strDeviceTypes.length > 0){
|
||||
for (String item : strDeviceTypes) {
|
||||
deviceTypeList.add(Integer.parseInt(item));
|
||||
}
|
||||
}
|
||||
if(deviceTypeList.size() > 0){
|
||||
map.put("deviceTypeList", deviceTypeList);
|
||||
}
|
||||
}else{
|
||||
map.put("deviceTypeList", DockTypeEnum.getKeyList());
|
||||
}
|
||||
List<IkDeviceEntity> deviceList = deviceService.getList(map);
|
||||
if(deviceList != null && deviceList.size() > 0){
|
||||
DeviceBasicVO model;
|
||||
for (IkDeviceEntity item : deviceList) {
|
||||
model = new DeviceBasicVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
} else {
|
||||
return Result.failed("获取当前用户失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.model.Result;
|
||||
import com.zlt.tourism.model.iking.IkOrganizationEntity;
|
||||
import com.zlt.tourism.service.IkOrganizationService;
|
||||
import com.zlt.tourism.vo.OrganizationBasicVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构管理
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 机构管理
|
||||
* @create 2024/8/7 15:00
|
||||
**/
|
||||
@Tag(name = "机构管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/org/")
|
||||
public class OrganizationController {
|
||||
|
||||
/**
|
||||
* 根据父级ID获取列表
|
||||
*
|
||||
* @param parentId 父级ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据父级ID获取列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "parentId", value = "父级ID", required = true, paramType = "query")
|
||||
// })
|
||||
@GetMapping(value = "listByParentId", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<OrganizationBasicVO>> listByParentId(Long parentId) {
|
||||
List<OrganizationBasicVO> list = new ArrayList<>();
|
||||
if (parentId == null) {
|
||||
parentId = 0L;
|
||||
}
|
||||
LambdaQueryWrapper<IkOrganizationEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(IkOrganizationEntity::getParentId, parentId);
|
||||
qw.eq(IkOrganizationEntity::getStatus, 0);
|
||||
List<IkOrganizationEntity> orgList = organizationService.list(qw);
|
||||
if (orgList != null && orgList.size() > 0) {
|
||||
OrganizationBasicVO model;
|
||||
for (IkOrganizationEntity item : orgList) {
|
||||
model = new OrganizationBasicVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkOrganizationService organizationService;
|
||||
|
||||
/**
|
||||
* 根据级别获取列表
|
||||
*
|
||||
* @param level 级别
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据级别获取列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "level", value = "级别", required = true, paramType = "query")
|
||||
// })
|
||||
@GetMapping(value = "listByLevel", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<OrganizationBasicVO>> listByLevel(Integer level) {
|
||||
List<OrganizationBasicVO> list = new ArrayList<>();
|
||||
if (level == null) {
|
||||
level = 0;
|
||||
}
|
||||
LambdaQueryWrapper<IkOrganizationEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(IkOrganizationEntity::getLevel, level);
|
||||
qw.eq(IkOrganizationEntity::getStatus, 0);
|
||||
List<IkOrganizationEntity> orgList = organizationService.list(qw);
|
||||
if (orgList != null && orgList.size() > 0) {
|
||||
OrganizationBasicVO model;
|
||||
for (IkOrganizationEntity item : orgList) {
|
||||
model = new OrganizationBasicVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.PanoramaPhotoAddDTO;
|
||||
import com.zlt.tourism.dto.PanoramaPhotoPageQuery;
|
||||
import com.zlt.tourism.dto.PanoramaPhotoUpdateDTO;
|
||||
import com.zlt.tourism.manager.PanoramaPhotoManager;
|
||||
import com.zlt.tourism.model.tourism.ScenicSpotEntity;
|
||||
import com.zlt.tourism.service.ScenicSpotService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.PanoramaPhotoPageVO;
|
||||
import com.zlt.tourism.vo.PanoramaPhotoVO;
|
||||
import com.zlt.tourism.vo.ValidScenicSpotVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 全景照片接口类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片接口类
|
||||
* @create 2024/7/18 17:44
|
||||
**/
|
||||
@Tag(name = "全景照片管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/panorama/photo/")
|
||||
public class PanoramaPhotoController {
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoManager panoramaPhotoManager;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody PanoramaPhotoAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = panoramaPhotoManager.add(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "编辑")
|
||||
@PutMapping(value = "update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result update(@Valid @RequestBody PanoramaPhotoUpdateDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = panoramaPhotoManager.update(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<PanoramaPhotoPageVO>> findPageList(@RequestBody PanoramaPhotoPageQuery query) {
|
||||
PageInfo<PanoramaPhotoPageVO> pageList = panoramaPhotoManager.selectPageList(query);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
try {
|
||||
Result result = panoramaPhotoManager.delete(id);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取实体
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据主键ID获取实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PanoramaPhotoVO> getEntity(@PathVariable("id") Long id) {
|
||||
PanoramaPhotoVO model = panoramaPhotoManager.getEntity(id);
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证景点是否已绑定全景照片
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "validExist", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<ValidScenicSpotVO> validExist(@NotNull(message = "景点ID不能为空") Long scenicSpotId, Long panoramaPhotoId){
|
||||
ValidScenicSpotVO model = new ValidScenicSpotVO();
|
||||
boolean existScenicSpot = panoramaPhotoManager.existScenicSpot(scenicSpotId, panoramaPhotoId);
|
||||
if(existScenicSpot){
|
||||
ScenicSpotEntity scenicSpotEntity = scenicSpotService.getById(scenicSpotId);
|
||||
if(scenicSpotEntity != null && StrUtil.isNotEmpty(scenicSpotEntity.getScenicSpotName())){
|
||||
model.setMsg("是否更新" + scenicSpotEntity.getScenicSpotName() + "下的全景照片");
|
||||
}else{
|
||||
return Result.failed("景点不存在!");
|
||||
}
|
||||
model.setStatus(-2);
|
||||
}else{
|
||||
model.setStatus(1);
|
||||
}
|
||||
return Result.succeed(model);
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.zlt.tourism.dto.PanoramaPhotoFeatureTagAddDTO;
|
||||
import com.zlt.tourism.model.tourism.PanoramaPhotoFeatureTagEntity;
|
||||
import com.zlt.tourism.service.PanoramaPhotoFeatureTagService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 全景照片特色景观标签接口类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片特色景观标签接口类
|
||||
* @create 2024/7/24 14:53
|
||||
**/
|
||||
@Tag(name = "全景照片特色景观标签管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/panorama/photo/feature/tag/")
|
||||
public class PanoramaPhotoFeatureTagController {
|
||||
|
||||
/**
|
||||
* 全景照片特色景观标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoFeatureTagService featureTagService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody PanoramaPhotoFeatureTagAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
PanoramaPhotoFeatureTagEntity entity = new PanoramaPhotoFeatureTagEntity();
|
||||
BeanUtil.copyProperties(model, entity);
|
||||
boolean existRecord = featureTagService.existRecord(entity);
|
||||
if(existRecord){
|
||||
return Result.failed("该关系已存在,操作失败!");
|
||||
}
|
||||
boolean addResult = featureTagService.save(entity);
|
||||
return addResult ? Result.succeed("新增成功") : Result.failed("新增失败");
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = featureTagService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.PopularScenicSpotAddBatchDTO;
|
||||
import com.zlt.tourism.dto.PopularScenicSpotAddDTO;
|
||||
import com.zlt.tourism.dto.PopularScenicSpotPageQuery;
|
||||
import com.zlt.tourism.model.tourism.PopularScenicSpotEntity;
|
||||
import com.zlt.tourism.model.tourism.ScenicSpotEntity;
|
||||
import com.zlt.tourism.service.PopularScenicSpotService;
|
||||
import com.zlt.tourism.service.ScenicSpotService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.PopularScenicSpotListBasicVO;
|
||||
import com.zlt.tourism.vo.PopularScenicSpotPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 热门景点控制器
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点控制器
|
||||
* @create 2024/7/19 9:06
|
||||
**/
|
||||
@Tag(name = "热门景点管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/popular/scenic/spot/")
|
||||
public class PopularScenicSpotController {
|
||||
|
||||
/**
|
||||
* 热门景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PopularScenicSpotService popularScenicSpotService;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody PopularScenicSpotAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
if (model.getScenicSpotId() != null) {
|
||||
PopularScenicSpotEntity entity = new PopularScenicSpotEntity();
|
||||
entity.setScenicSpotId(model.getScenicSpotId());
|
||||
entity.setOrderNumber(model.getOrderNumber() != null ? model.getOrderNumber() : 1);
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
boolean existScenicSpot = popularScenicSpotService.existScenicSpot(entity);
|
||||
if (existScenicSpot) {
|
||||
return Result.failed("该热门景点已存在,操作失败!");
|
||||
}
|
||||
boolean result = popularScenicSpotService.save(entity);
|
||||
return result ? Result.succeed("操作成功!") : Result.failed("操作失败!");
|
||||
} else {
|
||||
return Result.failed("景点ID为空,操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<PopularScenicSpotPageVO>> findPageList(@RequestBody PopularScenicSpotPageQuery query) {
|
||||
LambdaQueryWrapper<PopularScenicSpotEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByAsc(PopularScenicSpotEntity::getOrderNumber);
|
||||
PageInfo<PopularScenicSpotEntity> popularScenicSpotPageList = popularScenicSpotService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<PopularScenicSpotPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(popularScenicSpotPageList, pageList);
|
||||
if (popularScenicSpotPageList.getList() != null && popularScenicSpotPageList.getList().size() > 0) {
|
||||
List<PopularScenicSpotEntity> list = popularScenicSpotPageList.getList();
|
||||
List<PopularScenicSpotPageVO> voList = new ArrayList<>(list.size());
|
||||
for (PopularScenicSpotEntity item : list) {
|
||||
PopularScenicSpotPageVO model = new PopularScenicSpotPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if (item.getScenicSpotId() != null) {
|
||||
ScenicSpotEntity scenicSpotEntity = scenicSpotService.getById(item.getScenicSpotId());
|
||||
if (scenicSpotEntity != null && StrUtil.isNotEmpty(scenicSpotEntity.getScenicSpotName())) {
|
||||
model.setScenicSpotName(scenicSpotEntity.getScenicSpotName());
|
||||
}
|
||||
}
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "批量新增")
|
||||
@PostMapping(value = "addBatch", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result addBatch(@Valid @RequestBody PopularScenicSpotAddBatchDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
List<Long> scenicSpotIdList = model.getScenicSpotIdList();
|
||||
if (scenicSpotIdList != null && scenicSpotIdList.size() > 0) {
|
||||
//先删除
|
||||
LambdaQueryWrapper<PopularScenicSpotEntity> qw = new LambdaQueryWrapper<>();
|
||||
popularScenicSpotService.remove(qw);
|
||||
List<PopularScenicSpotEntity> list = new ArrayList(scenicSpotIdList.size());
|
||||
PopularScenicSpotEntity entity;
|
||||
int orderNumber = 1;
|
||||
for (Long item : scenicSpotIdList) {
|
||||
if(item != null){
|
||||
entity = new PopularScenicSpotEntity();
|
||||
entity.setScenicSpotId(item);
|
||||
entity.setOrderNumber(orderNumber);
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
list.add(entity);
|
||||
orderNumber++;
|
||||
}
|
||||
}
|
||||
boolean result = popularScenicSpotService.saveBatch(list);
|
||||
return result ? Result.succeed("操作成功!") : Result.failed("操作失败!");
|
||||
} else {
|
||||
return Result.failed("景点集合为空,操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = popularScenicSpotService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取列表")
|
||||
@GetMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<PopularScenicSpotListBasicVO>> findList() {
|
||||
LambdaQueryWrapper<PopularScenicSpotEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByAsc(PopularScenicSpotEntity::getOrderNumber);
|
||||
List<PopularScenicSpotEntity> tagList = popularScenicSpotService.list(qw);
|
||||
List<PopularScenicSpotListBasicVO> list = new ArrayList<>();
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
List<Long> scenicSpotIdList = tagList.stream().filter(o -> o.getScenicSpotId() != null).map(PopularScenicSpotEntity::getScenicSpotId).collect(Collectors.toList());
|
||||
PopularScenicSpotListBasicVO model;
|
||||
for (Long item : scenicSpotIdList) {
|
||||
model = new PopularScenicSpotListBasicVO();
|
||||
model.setScenicSpotId(item);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
if (list.size() < 10) {
|
||||
int size = 10 - list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
PopularScenicSpotListBasicVO model = new PopularScenicSpotListBasicVO();
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.PopularTagAddBatchDTO;
|
||||
import com.zlt.tourism.dto.PopularTagAddDTO;
|
||||
import com.zlt.tourism.dto.PopularTagPageQuery;
|
||||
import com.zlt.tourism.model.tourism.PopularTagEntity;
|
||||
import com.zlt.tourism.model.tourism.TourismTagEntity;
|
||||
import com.zlt.tourism.service.PopularTagService;
|
||||
import com.zlt.tourism.service.TourismTagService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.PopularTagListBasicVO;
|
||||
import com.zlt.tourism.vo.PopularTagPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 热门标签控制器
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签控制器
|
||||
* @create 2024/7/19 9:06
|
||||
**/
|
||||
@Tag(name = "热门标签管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/popular/tag/")
|
||||
public class PopularTagController {
|
||||
|
||||
/**
|
||||
* 热门标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PopularTagService popularTagService;
|
||||
|
||||
/**
|
||||
* 标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismTagService tagService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody PopularTagAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
PopularTagEntity entity = new PopularTagEntity();
|
||||
entity.setTagCode(model.getTagCode());
|
||||
entity.setOrderNumber(model.getOrderNumber() != null ? model.getOrderNumber() : 1);
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
boolean existScenicSpot = popularTagService.existTag(entity);
|
||||
if (existScenicSpot) {
|
||||
return Result.failed("该热门标签已存在,操作失败!");
|
||||
}
|
||||
boolean result = popularTagService.save(entity);
|
||||
return result ? Result.succeed("操作成功!") : Result.failed("操作失败!");
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<PopularTagPageVO>> findPageList(@RequestBody PopularTagPageQuery query) {
|
||||
LambdaQueryWrapper<PopularTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByAsc(PopularTagEntity::getOrderNumber);
|
||||
PageInfo<PopularTagEntity> popularTagPageList = popularTagService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<PopularTagPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(popularTagPageList, pageList);
|
||||
if (popularTagPageList.getList() != null && popularTagPageList.getList().size() > 0) {
|
||||
List<PopularTagEntity> list = popularTagPageList.getList();
|
||||
List<PopularTagPageVO> voList = new ArrayList<>(list.size());
|
||||
List<String> tagCodeList = list.stream().filter(o -> StrUtil.isNotEmpty(o.getTagCode())).map(PopularTagEntity::getTagCode).collect(Collectors.toList());
|
||||
List<TourismTagEntity> tourismTagList = tagService.getListByCodeList(tagCodeList);
|
||||
for (PopularTagEntity item : list) {
|
||||
PopularTagPageVO model = new PopularTagPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if (StrUtil.isNotEmpty(item.getTagCode()) && tourismTagList != null && tourismTagList.size() > 0) {
|
||||
List<TourismTagEntity> tempList = tourismTagList.stream().filter(o -> o.getTagCode().equals(item.getTagCode())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
model.setTagName(tempList.get(0).getTagName());
|
||||
}
|
||||
}
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "批量新增")
|
||||
@PostMapping(value = "addBatch", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result addBatch(@Valid @RequestBody PopularTagAddBatchDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
List<String> tagCodeList = model.getTagCodeList();
|
||||
if (tagCodeList != null && tagCodeList.size() > 0) {
|
||||
//先删除
|
||||
LambdaQueryWrapper<PopularTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
popularTagService.remove(qw);
|
||||
List<PopularTagEntity> list = new ArrayList(tagCodeList.size());
|
||||
PopularTagEntity entity;
|
||||
int orderNumber = 1;
|
||||
for (String item : tagCodeList) {
|
||||
if(item != null){
|
||||
entity = new PopularTagEntity();
|
||||
entity.setTagCode(item);
|
||||
entity.setOrderNumber(orderNumber);
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
list.add(entity);
|
||||
orderNumber++;
|
||||
}
|
||||
}
|
||||
boolean result = popularTagService.saveBatch(list);
|
||||
return result ? Result.succeed("操作成功!") : Result.failed("操作失败!");
|
||||
} else {
|
||||
return Result.failed("标签集合为空,操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = popularTagService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取列表")
|
||||
@GetMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<PopularTagListBasicVO>> findList() {
|
||||
LambdaQueryWrapper<PopularTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByAsc(PopularTagEntity::getOrderNumber);
|
||||
List<PopularTagEntity> tagList = popularTagService.list(qw);
|
||||
List<PopularTagListBasicVO> list = new ArrayList<>();
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
List<String> tagCodeList = tagList.stream().filter(o -> StrUtil.isNotEmpty(o.getTagCode())).map(PopularTagEntity::getTagCode).collect(Collectors.toList());
|
||||
PopularTagListBasicVO model;
|
||||
for (String item : tagCodeList) {
|
||||
model = new PopularTagListBasicVO();
|
||||
model.setTagCode(item);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
if (list.size() < 5) {
|
||||
int size = 5 - list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
PopularTagListBasicVO model = new PopularTagListBasicVO();
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.model.Result;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.RouteBasicPageQuery;
|
||||
import com.zlt.tourism.dto.route.RoutePageQuery;
|
||||
import com.zlt.tourism.feign.StationWebService;
|
||||
import com.zlt.tourism.model.iking.IkDeviceEntity;
|
||||
import com.zlt.tourism.model.iking.IkRouteEntity;
|
||||
import com.zlt.tourism.model.tourism.ScenicSpotDeviceEntity;
|
||||
import com.zlt.tourism.service.IkDeviceService;
|
||||
import com.zlt.tourism.service.IkRouteService;
|
||||
import com.zlt.tourism.service.ScenicSpotDeviceService;
|
||||
import com.zlt.tourism.vo.RouteTreeVO;
|
||||
import com.zlt.tourism.vo.RouteVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 航线控制类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 航线控制类
|
||||
* @create 2024/8/7 8:47
|
||||
**/
|
||||
@Tag(name = "航线管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/route/")
|
||||
public class RouteController {
|
||||
|
||||
/**
|
||||
* 航线业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkRouteService ikRouteService;
|
||||
|
||||
/**
|
||||
* 景点和设备关系业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotDeviceService scenicSpotDeviceService;
|
||||
|
||||
/**
|
||||
* 设备业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkDeviceService deviceService;
|
||||
|
||||
/**
|
||||
* station-web模块远程调用
|
||||
*/
|
||||
@Autowired
|
||||
private StationWebService stationWebService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据设备SN获取航线列表
|
||||
*
|
||||
* @param deviceSn 设备SN
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据设备SN获取航线列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "deviceSn", value = "设备SN", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "listByDeviceSn/{deviceSn}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<RouteVO>> getListByDeviceSn(@PathVariable("deviceSn") String deviceSn) {
|
||||
List<RouteVO> list = new ArrayList<>();
|
||||
LambdaQueryWrapper<IkRouteEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(IkRouteEntity::getDeviceSn, deviceSn);
|
||||
qw.eq(IkRouteEntity::getDeleted, 0);
|
||||
List<IkRouteEntity> routeList = ikRouteService.list(qw);
|
||||
if (routeList != null && routeList.size() > 0) {
|
||||
RouteVO model;
|
||||
for (IkRouteEntity item : routeList) {
|
||||
model = new RouteVO();
|
||||
model.setRouteId(item.getId());
|
||||
model.setRouteName(item.getRouteName());
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
/*if(StrUtil.isNotEmpty(deviceSn)){
|
||||
IkDeviceEntity deviceEntity = deviceService.getByDeviceSn(deviceSn);
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
List<IkRouteEntity> routeList = ikRouteService.getNearbyRouteList(deviceEntity.getLongitude(), deviceEntity.getLatitude());
|
||||
if (routeList != null && routeList.size() > 0) {
|
||||
RouteVO model;
|
||||
for (IkRouteEntity item : routeList) {
|
||||
model = new RouteVO();
|
||||
model.setRouteId(item.getId());
|
||||
model.setRouteName(item.getRouteName());
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return Result.failed("设备不存在,查询失败!");
|
||||
}
|
||||
}else{
|
||||
return Result.failed("设备SN为空,查询失败!");
|
||||
}*/
|
||||
return Result.succeed(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据景点ID获取航线列表
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据景点ID获取航线列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "scenicSpotId", value = "景点ID", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "listByScenicSpotId/{scenicSpotId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<RouteVO>> getListBScenicSpotId(@PathVariable("scenicSpotId") Long scenicSpotId) {
|
||||
String deviceSn = "";
|
||||
List<ScenicSpotDeviceEntity> list = scenicSpotDeviceService.getListByScenicSpotId(scenicSpotId);
|
||||
if (list != null && list.size() > 0) {
|
||||
List<ScenicSpotDeviceEntity> tempList = list.stream().filter(o -> StrUtil.isNotEmpty(o.getDeviceSn())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
deviceSn = tempList.get(0).getDeviceSn();
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(deviceSn)) {
|
||||
return getListByDeviceSn(deviceSn);
|
||||
}
|
||||
return Result.failed("该景点没有关联设备!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageListTest", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<RouteVO>> findPageList(@RequestBody RouteBasicPageQuery query) {
|
||||
PageInfo<RouteVO> pageList = new PageInfo<>();
|
||||
pageList.setPages(0);
|
||||
pageList.setTotal(0);
|
||||
List<RouteVO> voList = new ArrayList<>();
|
||||
BigDecimal longitude = null;
|
||||
BigDecimal latitude = null;
|
||||
IkDeviceEntity deviceEntity = null;
|
||||
if(StrUtil.isNotEmpty(query.getDeviceSn())){
|
||||
deviceEntity = getDeviceByDeviceSn(query.getDeviceSn());
|
||||
}else if(query.getScenicSpotId() != null){
|
||||
String deviceSn = "";
|
||||
List<ScenicSpotDeviceEntity> list = scenicSpotDeviceService.getListByScenicSpotId(query.getScenicSpotId());
|
||||
if (list != null && list.size() > 0) {
|
||||
List<ScenicSpotDeviceEntity> tempList = list.stream().filter(o -> StrUtil.isNotEmpty(o.getDeviceSn())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
deviceSn = tempList.get(0).getDeviceSn();
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(deviceSn)) {
|
||||
deviceEntity = getDeviceByDeviceSn(deviceSn);
|
||||
}
|
||||
}
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
longitude = deviceEntity.getLongitude();
|
||||
latitude = deviceEntity.getLatitude();
|
||||
if(longitude != null && latitude != null){
|
||||
Map<String, Object> map = new HashMap<>(3);
|
||||
if(longitude != null){
|
||||
map.put("longitude", longitude.toString());
|
||||
}
|
||||
if(latitude != null){
|
||||
map.put("latitude", latitude.toString());
|
||||
}
|
||||
BigDecimal limit = new BigDecimal(6000).setScale(7, BigDecimal.ROUND_HALF_UP);
|
||||
map.put("radius", limit);
|
||||
PageInfo<IkRouteEntity> routePage = ikRouteService.getNearbyRoutePageList(query.getPager(), map);
|
||||
BeanUtil.copyProperties(routePage, pageList);
|
||||
if (routePage.getList() != null && routePage.getList().size() > 0) {
|
||||
List<IkRouteEntity> list = routePage.getList();
|
||||
for (IkRouteEntity item : list) {
|
||||
RouteVO model = new RouteVO();
|
||||
model.setRouteId(item.getId());
|
||||
model.setId(item.getId());
|
||||
model.setParentId(item.getParentId());
|
||||
// String routeName = RSAUtil.decryptOne(item.getRouteName());
|
||||
model.setRouteName(item.getRouteName());
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树形分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取树形分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<RouteTreeVO>> findTreePageList(@RequestBody RouteBasicPageQuery query) {
|
||||
PageInfo<RouteTreeVO> pageList = new PageInfo<>();
|
||||
pageList.setPages(0);
|
||||
pageList.setTotal(0);
|
||||
List<RouteTreeVO> voList = new ArrayList<>();
|
||||
RoutePageQuery routePageQuery = new RoutePageQuery();
|
||||
BeanUtil.copyProperties(query, routePageQuery);
|
||||
routePageQuery.setChannel(1);
|
||||
routePageQuery.setVersion("_3_6_4");
|
||||
routePageQuery.setDeviceSn(null);
|
||||
IkDeviceEntity deviceEntity = null;
|
||||
if(StrUtil.isNotEmpty(query.getDeviceSn())){
|
||||
deviceEntity = getDeviceByDeviceSn(query.getDeviceSn());
|
||||
}else if(query.getScenicSpotId() != null){
|
||||
String deviceSn = "";
|
||||
List<ScenicSpotDeviceEntity> list = scenicSpotDeviceService.getListByScenicSpotId(query.getScenicSpotId());
|
||||
if (list != null && list.size() > 0) {
|
||||
List<ScenicSpotDeviceEntity> tempList = list.stream().filter(o -> StrUtil.isNotEmpty(o.getDeviceSn())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
deviceSn = tempList.get(0).getDeviceSn();
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(deviceSn)) {
|
||||
deviceEntity = getDeviceByDeviceSn(deviceSn);
|
||||
}
|
||||
}
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
if(deviceEntity.getLongitude() != null){
|
||||
routePageQuery.setLongitude(deviceEntity.getLongitude().toString());
|
||||
}
|
||||
if(deviceEntity.getLatitude() != null){
|
||||
routePageQuery.setLatitude(deviceEntity.getLatitude().toString());
|
||||
}
|
||||
}
|
||||
Object object = stationWebService.getRouteList(routePageQuery);
|
||||
if(object != null){
|
||||
String dataStr = JSONObject.toJSONString(object);
|
||||
JSONObject jsonObject = JSONObject.parseObject(dataStr);
|
||||
if(jsonObject != null && jsonObject.containsKey("flag") && 0 == jsonObject.getInteger("flag")){
|
||||
Object data = jsonObject.get("data");
|
||||
String pageStr = JSONObject.toJSONString(data);
|
||||
JSONObject pageData = JSONObject.parseObject(pageStr);
|
||||
if(pageData != null){
|
||||
int totalCount = 0;
|
||||
int totalPage = 0;
|
||||
if(pageData.containsKey("totalCount")){
|
||||
totalCount = pageData.getInteger("totalCount");
|
||||
}
|
||||
if(pageData.containsKey("totalPage")){
|
||||
totalPage = pageData.getInteger("totalPage");
|
||||
}
|
||||
if(pageData.containsKey("list")){
|
||||
JSONArray jsonArray = pageData.getJSONArray("list");
|
||||
if(jsonArray != null && jsonArray.size() > 0){
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
RouteTreeVO model = JSONObject.toJavaObject(jsonArray.getJSONObject(i), RouteTreeVO.class);
|
||||
model.setRouteName(model.getRouteNameDecode());
|
||||
voList.add(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
pageList.setPages(totalPage);
|
||||
pageList.setTotal(totalCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
pageList.setList(voList);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备SN获取设备实体
|
||||
* @param deviceSn 设备SN
|
||||
* @return
|
||||
*/
|
||||
private IkDeviceEntity getDeviceByDeviceSn(String deviceSn){
|
||||
if(StrUtil.isNotEmpty(deviceSn)){
|
||||
IkDeviceEntity deviceEntity = deviceService.getByDeviceSn(deviceSn);
|
||||
return deviceEntity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+305
@@ -0,0 +1,305 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.ScenicSpotAddDTO;
|
||||
import com.zlt.tourism.dto.ScenicSpotPageQuery;
|
||||
import com.zlt.tourism.dto.ScenicSpotUpdateDTO;
|
||||
import com.zlt.tourism.manager.ScenicSpotManager;
|
||||
import com.zlt.tourism.model.iking.IkDeviceEntity;
|
||||
import com.zlt.tourism.model.tourism.*;
|
||||
import com.zlt.tourism.service.*;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 景点控制器类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点控制器类
|
||||
* @create 2024/7/18 11:49
|
||||
**/
|
||||
@Tag(name = "景点管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/scenic/spot/")
|
||||
public class ScenicSpotController {
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotManager scenicSpotManager;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 景点设备关系业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotDeviceService scenicSpotDeviceService;
|
||||
|
||||
/**
|
||||
* 设备业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkDeviceService ikDeviceService;
|
||||
|
||||
/**
|
||||
* 景点和标签关系业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotTagService scenicSpotTagService;
|
||||
|
||||
/**
|
||||
* 标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismTagService tourismTagService;
|
||||
|
||||
/**
|
||||
* 双轴视频业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoService biaxVideoService;
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoService panoramaPhotoService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody ScenicSpotAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = scenicSpotManager.add(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "编辑")
|
||||
@PutMapping(value = "update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result update(@Valid @RequestBody ScenicSpotUpdateDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
Result result = scenicSpotManager.update(model, user.getId());
|
||||
return result;
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备SN获取实体
|
||||
*
|
||||
* @param deviceSn 设备Sn
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据设备SN获取实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "deviceSn", value = "设备SN", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "getByDeviceSn/{deviceSn}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<ScenicSpotVO> getEntityByDeviceSn(@PathVariable("deviceSn") String deviceSn) {
|
||||
ScenicSpotVO model = scenicSpotManager.getByDeviceSn(deviceSn);
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取实体
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据主键ID获取实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<ScenicSpotVO> getEntity(@PathVariable("id") Long id) {
|
||||
ScenicSpotVO model = scenicSpotManager.getEntity(id);
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<ScenicSpotPageVO>> findPageList(@RequestBody ScenicSpotPageQuery query) {
|
||||
PageInfo<ScenicSpotPageVO> pageList = scenicSpotManager.selectPageList(query);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
try {
|
||||
Result result = scenicSpotManager.delete(id);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据景点名称获取列表
|
||||
*
|
||||
* @param scenicSpotName 景点名称
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据景点名称获取列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "scenicSpotName", value = "景点名称", required = false, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "queryType", value = "查询类别,1:双轴视频,2:全景照片", required = false, paramType = "query")
|
||||
// })
|
||||
@GetMapping(value = "listByName", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<ScenicSpotBaseListVO>> findListByName(String scenicSpotName, Integer queryType) {
|
||||
LambdaQueryWrapper<ScenicSpotEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.like(StrUtil.isNotEmpty(scenicSpotName), ScenicSpotEntity::getScenicSpotName, scenicSpotName);
|
||||
qw.orderByDesc(ScenicSpotEntity::getCreatedAt);
|
||||
List<ScenicSpotEntity> tagList = scenicSpotService.list(qw);
|
||||
List<ScenicSpotBaseListVO> list = new ArrayList<>();
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
ScenicSpotBaseListVO model;
|
||||
for (ScenicSpotEntity item : tagList) {
|
||||
model = new ScenicSpotBaseListVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if(queryType != null && queryType == 1){
|
||||
List<BiaxVideoEntity> biaxVideoList = biaxVideoService.getListByScenicSpotId(item.getId());
|
||||
if(biaxVideoList != null && biaxVideoList.size() > 0){
|
||||
model.setScenicSpotName(item.getScenicSpotName() + "(" + biaxVideoList.get(0).getBiaxVideoName() + ")");
|
||||
}
|
||||
}else if(queryType != null && queryType == 2){
|
||||
List<PanoramaPhotoEntity> panoramaPhotoList = panoramaPhotoService.getListByScenicSpotId(item.getId());
|
||||
if(panoramaPhotoList != null && panoramaPhotoList.size() > 0){
|
||||
model.setScenicSpotName(item.getScenicSpotName() + "(" + panoramaPhotoList.get(0).getPhotoName() + ")");
|
||||
}
|
||||
}
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据景点ID获取设备
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据景点ID获取设备")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "scenicSpotId", value = "设备SN", required = true, paramType = "path")
|
||||
// })
|
||||
@GetMapping(value = "getDeviceByScenicSpotId/{scenicSpotId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<IkDeviceVO> getDeviceByScenicSpotId(@PathVariable("scenicSpotId") Long scenicSpotId) {
|
||||
IkDeviceVO model = new IkDeviceVO();
|
||||
List<ScenicSpotDeviceEntity> list = scenicSpotDeviceService.getListByScenicSpotId(scenicSpotId);
|
||||
if(list != null && list.size() > 0){
|
||||
IkDeviceEntity deviceEntity = ikDeviceService.getByDeviceSn(list.get(0).getDeviceSn());
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
BeanUtil.copyProperties(deviceEntity, model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据景点ID获取标签列表
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据景点ID获取标签列表")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "scenicSpotId", value = "景点ID", required = true, paramType = "query")
|
||||
// })
|
||||
@GetMapping(value = "getTagListByScenicSpotId", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<TourismTagListVO>> getTagListByScenicSpotId(Long scenicSpotId) {
|
||||
List<TourismTagListVO> list = new ArrayList<>();
|
||||
LambdaQueryWrapper<TourismTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
if(scenicSpotId != null){
|
||||
List<ScenicSpotTagEntity> scenicSpotTagList = scenicSpotTagService.getListByScenicSpotId(scenicSpotId);
|
||||
if(scenicSpotTagList != null && scenicSpotTagList.size() > 0){
|
||||
List<String> tagCodeList = scenicSpotTagList.stream().map(ScenicSpotTagEntity::getTagCode).collect(Collectors.toList());
|
||||
if (tagCodeList != null && tagCodeList.size() > 0) {
|
||||
qw.in(TourismTagEntity::getTagCode, tagCodeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
qw.orderByAsc(TourismTagEntity::getOrderNumber);
|
||||
List<TourismTagEntity> tagList = tourismTagService.list(qw);
|
||||
if(tagList != null && tagList.size() > 0) {
|
||||
TourismTagListVO model;
|
||||
for (TourismTagEntity item : tagList) {
|
||||
model = new TourismTagListVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import com.central.common.model.Result;
|
||||
import com.zlt.tourism.dto.UploadFileDTO;
|
||||
import com.zlt.tourism.feign.StationWebService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件管理控制类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 文件管理控制类
|
||||
* @create 2024/7/24 11:29
|
||||
**/
|
||||
@Tag(name = "文旅文件管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/file/")
|
||||
public class TourismFileController {
|
||||
|
||||
/**
|
||||
* 文件业务类
|
||||
*/
|
||||
@Autowired
|
||||
private StationWebService stationWebService;
|
||||
|
||||
/**
|
||||
* 上传
|
||||
*/
|
||||
@Operation(summary = "上传")
|
||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public Result upload(@RequestPart("file") MultipartFile file) {
|
||||
try {
|
||||
Result result = stationWebService.uploadFile(file);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return Result.failed("上传文件失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
@Operation(summary = "上传文件")
|
||||
@PostMapping(value = "/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public Result uploadFile(UploadFileDTO model) {
|
||||
if(model.getFileList() == null || model.getFileList().size() == 0){
|
||||
return Result.failed("文件为空,上传失败!");
|
||||
}
|
||||
try {
|
||||
Result result = stationWebService.uploadFile(model.getFileList().get(0));
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return Result.failed("上传文件失败!");
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import com.central.common.model.Result;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.model.iking.IkMissionEntity;
|
||||
import com.zlt.tourism.query.MissionServicePageQuery;
|
||||
import com.zlt.tourism.query.TourismUserPageQuery;
|
||||
import com.zlt.tourism.service.IkMissionService;
|
||||
import com.zlt.tourism.vo.TourismUserPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: duzhichao
|
||||
* @CreateTime: 2024-11-05 11:40
|
||||
* @Description: mgnt查询任务
|
||||
*/
|
||||
@Tag(name = "文旅用户管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/service/mission/")
|
||||
public class TourismMissionController {
|
||||
|
||||
@Resource
|
||||
IkMissionService ikMissionService;
|
||||
|
||||
|
||||
@Operation(summary = "获取文旅任务分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<IkMissionEntity>> findPageList(@RequestBody MissionServicePageQuery query) {
|
||||
PageInfo<IkMissionEntity> pageList= ikMissionService.queryPage(query);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.TourismStreamerAddDTO;
|
||||
import com.zlt.tourism.dto.TourismStreamerPageQuery;
|
||||
import com.zlt.tourism.feign.UserCenterService;
|
||||
import com.zlt.tourism.model.tourism.TourismStreamerEntity;
|
||||
import com.zlt.tourism.service.TourismStreamerService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.TourismStreamerListVO;
|
||||
import com.zlt.tourism.vo.TourismStreamerPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主播控制器
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 主播控制器
|
||||
* @create 2024/7/19 10:41
|
||||
**/
|
||||
@Tag(name = "主播权限管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/streamer/")
|
||||
public class TourismStreamerController {
|
||||
|
||||
/**
|
||||
* 主播业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismStreamerService streamerService;
|
||||
|
||||
/**
|
||||
* 用户业务类
|
||||
*/
|
||||
@Autowired
|
||||
private UserCenterService userCenterService;
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<TourismStreamerPageVO>> findPageList(@RequestBody TourismStreamerPageQuery query) {
|
||||
LambdaQueryWrapper<TourismStreamerEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.like(StrUtil.isNotEmpty(query.getUserName()), TourismStreamerEntity::getUserName, query.getUserName());
|
||||
qw.like(StrUtil.isNotEmpty(query.getRealName()), TourismStreamerEntity::getRealName, query.getRealName());
|
||||
qw.like(StrUtil.isNotEmpty(query.getMobile()), TourismStreamerEntity::getMobile, query.getMobile());
|
||||
qw.eq(query.getStreamerType() != null, TourismStreamerEntity::getStreamerType, query.getStreamerType());
|
||||
qw.orderByDesc(TourismStreamerEntity::getCreatedAt);
|
||||
PageInfo<TourismStreamerEntity> tagPageList = streamerService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<TourismStreamerPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(tagPageList, pageList);
|
||||
if (tagPageList.getList() != null && tagPageList.getList().size() > 0) {
|
||||
List<TourismStreamerEntity> list = tagPageList.getList();
|
||||
List<TourismStreamerPageVO> voList = new ArrayList<>(list.size());
|
||||
for (TourismStreamerEntity item : list) {
|
||||
TourismStreamerPageVO model = new TourismStreamerPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody TourismStreamerAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if(user == null || user.getId() == null){
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
SysUser sysUser = userCenterService.findByMobile(model.getMobile());
|
||||
if(sysUser == null || sysUser.getId() == null){
|
||||
return Result.failed(3,"未检索到对应用户!");
|
||||
}
|
||||
boolean existMobile = streamerService.existMobile(model.getMobile());
|
||||
if (existMobile) {
|
||||
return Result.failed(2,"该用户已拥有主播权限!");
|
||||
}
|
||||
TourismStreamerEntity entity = new TourismStreamerEntity();
|
||||
entity.setUserId(sysUser.getId());
|
||||
entity.setUserName(sysUser.getUsername());
|
||||
entity.setRealName(sysUser.getNickname());
|
||||
entity.setMobile(model.getMobile());
|
||||
entity.setStreamerType(1);
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
boolean addResult = streamerService.save(entity);
|
||||
return addResult ? Result.succeed(1, "主播权限已开通!") : Result.failed("主播权限开通失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = streamerService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取全部列表")
|
||||
@GetMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<TourismStreamerListVO>> findList() {
|
||||
LambdaQueryWrapper<TourismStreamerEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByDesc(TourismStreamerEntity::getCreatedAt);
|
||||
List<TourismStreamerEntity> tagList = streamerService.list(qw);
|
||||
List<TourismStreamerListVO> list = new ArrayList<>();
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
TourismStreamerListVO model;
|
||||
for (TourismStreamerEntity item : tagList) {
|
||||
model = new TourismStreamerListVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.context.LoginUserContextHolder;
|
||||
import com.central.common.model.LoginAppUser;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.model.SysUser;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.TourismTagAddDTO;
|
||||
import com.zlt.tourism.dto.TourismTagPageQuery;
|
||||
import com.zlt.tourism.dto.TourismTagUpdateDTO;
|
||||
import com.zlt.tourism.model.tourism.TourismTagEntity;
|
||||
import com.zlt.tourism.service.TourismTagService;
|
||||
import com.zlt.tourism.util.ParamsErrorUtil;
|
||||
import com.zlt.tourism.vo.TourismTagListVO;
|
||||
import com.zlt.tourism.vo.TourismTagPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 标签接口类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签接口类
|
||||
* @create 2024/7/17 13:10
|
||||
**/
|
||||
@Tag(name = "标签管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/api/tag/")
|
||||
public class TourismTagController {
|
||||
|
||||
/**
|
||||
* 标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismTagService tourismTagService;
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "根据查询对象,获取分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<TourismTagPageVO>> findPageList(@RequestBody TourismTagPageQuery query) {
|
||||
LambdaQueryWrapper<TourismTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.like(StrUtil.isNotEmpty(query.getTagName()), TourismTagEntity::getTagName, query.getTagName());
|
||||
qw.orderByDesc(TourismTagEntity::getCreatedAt);
|
||||
PageInfo<TourismTagEntity> tagPageList = tourismTagService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<TourismTagPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(tagPageList, pageList);
|
||||
if (tagPageList.getList() != null && tagPageList.getList().size() > 0) {
|
||||
List<TourismTagEntity> list = tagPageList.getList();
|
||||
List<TourismTagPageVO> voList = new ArrayList<>(list.size());
|
||||
for (TourismTagEntity item : list) {
|
||||
TourismTagPageVO model = new TourismTagPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result add(@Valid @RequestBody TourismTagAddDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user != null && user.getId() != null) {
|
||||
TourismTagEntity entity = new TourismTagEntity();
|
||||
BeanUtil.copyProperties(model, entity);
|
||||
boolean existCode = tourismTagService.existCode(entity);
|
||||
if (existCode) {
|
||||
return Result.failed("该标签编码已存在,操作失败!");
|
||||
}
|
||||
boolean existName = tourismTagService.existName(entity);
|
||||
if (existName) {
|
||||
return Result.failed("该标签名称已存在,操作失败!");
|
||||
}
|
||||
entity.setCreateUserId(user.getId());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
boolean addResult = tourismTagService.save(entity);
|
||||
return addResult ? Result.succeed("") : Result.failed("");
|
||||
} else {
|
||||
return Result.failed("获取登录用户失败,请重新登录");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param model 实体
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "更新")
|
||||
@PutMapping(value = "update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result update(@Valid @RequestBody TourismTagUpdateDTO model, BindingResult paramResult) {
|
||||
if (paramResult.hasErrors()) {
|
||||
Map<String, String> map = ParamsErrorUtil.getErrors(paramResult);
|
||||
return Result.failed(map.values().toString());
|
||||
}
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
if (user == null || user.getId() == null) {
|
||||
return Result.failed("获取登录用户失败,请重新登录!");
|
||||
}
|
||||
TourismTagEntity entity = tourismTagService.getById(model.getId());
|
||||
if (entity != null && entity.getId() != null) {
|
||||
if(!model.getTagCode().equals(entity.getTagCode())){
|
||||
boolean isUse = tourismTagService.isUse(entity.getTagCode());
|
||||
if(isUse){
|
||||
return Result.failed("该标签编码已使用,不能修改编码!");
|
||||
}
|
||||
}
|
||||
entity.setTagCode(model.getTagCode());
|
||||
entity.setTagName(model.getTagName());
|
||||
entity.setOrderNumber(model.getOrderNumber());
|
||||
entity.setUpdatedAt(new Date());
|
||||
entity.setUpdateUserId(user.getId());
|
||||
boolean existCode = tourismTagService.existCode(entity);
|
||||
if (existCode) {
|
||||
return Result.failed("该标签编码已存在,操作失败!");
|
||||
}
|
||||
boolean existName = tourismTagService.existName(entity);
|
||||
if (existName) {
|
||||
return Result.failed("该标签名称已存在,操作失败!");
|
||||
}
|
||||
boolean updateResult = tourismTagService.updateById(entity);
|
||||
return updateResult ? Result.succeed("") : Result.failed("");
|
||||
} else {
|
||||
return Result.failed("该记录不存在,请确认!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "path")
|
||||
// })
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
TourismTagEntity entity = tourismTagService.getById(id);
|
||||
if(entity == null || StrUtil.isEmpty(entity.getTagCode())){
|
||||
return Result.failed("该记录不存在,删除失败!");
|
||||
}
|
||||
boolean isUse = tourismTagService.isUse(entity.getTagCode());
|
||||
if(isUse){
|
||||
return Result.failed("该标签编码已使用,不能删除!");
|
||||
}
|
||||
boolean result = tourismTagService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取全部列表")
|
||||
@GetMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<List<TourismTagListVO>> findList() {
|
||||
LambdaQueryWrapper<TourismTagEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByAsc(TourismTagEntity::getOrderNumber);
|
||||
List<TourismTagEntity> tagList = tourismTagService.list(qw);
|
||||
List<TourismTagListVO> list = new ArrayList<>();
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
TourismTagListVO model;
|
||||
for (TourismTagEntity item : tagList) {
|
||||
model = new TourismTagListVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
return Result.succeed(list);
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.zlt.tourism.controller;
|
||||
|
||||
import com.central.common.model.Result;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.query.TourismUserPageQuery;
|
||||
import com.zlt.tourism.service.TourismUserService;
|
||||
import com.zlt.tourism.vo.TourismUserPageVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: duzhichao
|
||||
* @CreateTime: 2024-10-08 11:17
|
||||
* @Description: 文旅用户后台管理
|
||||
*/
|
||||
@Tag(name = "文旅用户管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/tourism/service/user/")
|
||||
public class TourismUserController {
|
||||
|
||||
@Resource
|
||||
private TourismUserService tourismUserService;
|
||||
|
||||
@Operation(summary = "获取文旅用户分页列表")
|
||||
@PostMapping(value = "pageList", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result<PageInfo<TourismUserPageVO>> findPageList(@RequestBody TourismUserPageQuery query) {
|
||||
PageInfo<TourismUserPageVO> pageList= tourismUserService.findUserPageList(query);
|
||||
return Result.succeed(pageList);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "删除,根据主键ID删除实体")
|
||||
@DeleteMapping(value = "delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Result delete(@PathVariable("id") Long id) {
|
||||
boolean result = tourismUserService.removeById(id);
|
||||
if (result) {
|
||||
return Result.succeed("删除成功!");
|
||||
} else {
|
||||
return Result.failed("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频新增实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频新增实体类")
|
||||
public class BiaxVideoAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
@NotBlank(message = "双轴视频名称不能为空")
|
||||
@Size(max = 128, message = "双轴视频名称长度超过128位")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
/*@NotNull(message = "关联景点不能为空")*/
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 设备SN
|
||||
*/
|
||||
@Schema(description ="设备SN")
|
||||
@NotBlank(message = "设备SN不能为空")
|
||||
@Size(max = 50, message = "设备SN长度超过50位")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@NotNull(message = "关联航线不能为空")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@Schema(description ="视频文件")
|
||||
@NotNull(message = "视频文件不能为空")
|
||||
private FileInfoDto videoFile;
|
||||
|
||||
/**
|
||||
* 视频时长(秒)
|
||||
*/
|
||||
@Schema(description ="视频时长(秒)")
|
||||
@NotNull(message = "视频时长不能为空")
|
||||
private Integer videoMins;
|
||||
|
||||
/**
|
||||
* 上轴标记点每段时长(秒)
|
||||
*/
|
||||
@Schema(description ="上轴标记点每段时长(秒)")
|
||||
@NotNull(message = "上轴标记点每段时长不能为空")
|
||||
private Integer upTagPosition;
|
||||
|
||||
/**
|
||||
* 上轴标记点列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点列表")
|
||||
@NotEmpty(message = "上轴标记点不能为空")
|
||||
private List<BiaxVideoUpTagAddDTO> upTagList;
|
||||
|
||||
/**
|
||||
* 下轴轴标记点列表
|
||||
*/
|
||||
@Schema(description ="下轴轴标记点列表")
|
||||
@NotEmpty(message = "下轴轴标记点不能为空")
|
||||
private List<BiaxVideoDownTagAddDTO> downTagList;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频新增实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频新增实体类")
|
||||
public class BiaxVideoBasicAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
@NotBlank(message = "双轴视频名称不能为空")
|
||||
@Size(max = 128, message = "双轴视频名称长度超过128位")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@NotNull(message = "关联景点不能为空")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@NotNull(message = "关联航线不能为空")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@Schema(description ="视频文件")
|
||||
@NotNull(message = "视频文件不能为空")
|
||||
private FileInfoDto videoFile;
|
||||
|
||||
/**
|
||||
* 视频时长(秒)
|
||||
*/
|
||||
@Schema(description ="视频时长(秒)")
|
||||
@NotNull(message = "视频时长不能为空")
|
||||
private Integer videoMins;
|
||||
|
||||
/**
|
||||
* 上轴标记点每段时长(秒)
|
||||
*/
|
||||
@Schema(description ="上轴标记点每段时长(秒)")
|
||||
@NotNull(message = "上轴标记点每段时长不能为空")
|
||||
private Integer upTagPosition;
|
||||
|
||||
/**
|
||||
* 上轴标记点列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点列表")
|
||||
@NotEmpty(message = "上轴标记点不能为空")
|
||||
private List<BiaxVideoUpTagAddDTO> upTagList;
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频基础信息更新实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频基础信息更新实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频基础信息更新实体类")
|
||||
public class BiaxVideoBasicUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@NotNull(message = "关联景点不能为空")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@NotNull(message = "关联航线不能为空")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
@NotBlank(message = "双轴视频名称不能为空")
|
||||
@Size(max = 126, message = "双轴视频名称长度超过128位")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@Schema(description ="视频文件")
|
||||
@NotNull(message = "视频文件不能为空")
|
||||
private FileInfoDto videoFile;
|
||||
|
||||
/**
|
||||
* 视频时长(秒)
|
||||
*/
|
||||
@Schema(description ="视频时长(秒)")
|
||||
@NotNull(message = "视频时长不能为空")
|
||||
private Integer videoMins;
|
||||
|
||||
/**
|
||||
* 上轴标记点每段时长(秒)
|
||||
*/
|
||||
@Schema(description ="上轴标记点每段时长(秒)")
|
||||
@NotNull(message = "上轴标记点每段时长不能为空")
|
||||
private Integer upTagPosition;
|
||||
|
||||
/**
|
||||
* 上轴标记点列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点列表")
|
||||
@NotEmpty(message = "上轴标记点不能为空")
|
||||
private List<BiaxVideoUpTagAddDTO> upTagList;
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 双轴视频上轴标记新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频上轴标记新增实体类
|
||||
* @create 2024/7/18 8:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频上轴标记新增实体类")
|
||||
public class BiaxVideoDownTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标记位置(mm:ss)
|
||||
*/
|
||||
@Schema(description ="标记位置(mm:ss)")
|
||||
private String tagPosition;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频下轴标记点新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频下轴标记点新增实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频下轴标记点新增实体类")
|
||||
public class BiaxVideoDownTagListAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 下轴轴标记点列表
|
||||
*/
|
||||
@Schema(description ="下轴轴标记点列表")
|
||||
@NotEmpty(message = "下轴轴标记点不能为空")
|
||||
private List<BiaxVideoDownTagAddDTO> downTagList;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 双轴视频特色景观标签新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频特色景观标签新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="双轴视频特色景观标签新增实体类")
|
||||
@Data
|
||||
public class BiaxVideoFeatureTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
@NotBlank(message = "标签编码不能为空")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 双轴视频ID
|
||||
*/
|
||||
@Schema(description ="双轴视频ID")
|
||||
@NotNull(message = "双轴视频ID不能为空")
|
||||
private Long biaxVideoId;
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 双轴视频分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="双轴视频分页查询类")
|
||||
@Data
|
||||
public class BiaxVideoPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
private String biaxVideoName;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 双轴视频上轴标记新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频上轴标记新增实体类
|
||||
* @create 2024/7/18 8:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频上轴标记新增实体类")
|
||||
public class BiaxVideoUpTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频更新实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频更新实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频更新实体类")
|
||||
public class BiaxVideoUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
/*@NotNull(message = "关联景点不能为空")*/
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 设备SN
|
||||
*/
|
||||
@Schema(description ="设备SN")
|
||||
@NotBlank(message = "设备SN不能为空")
|
||||
@Size(max = 50, message = "设备SN长度超过50位")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@NotNull(message = "关联航线不能为空")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
@NotBlank(message = "双轴视频名称不能为空")
|
||||
@Size(max = 126, message = "双轴视频名称长度超过128位")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@Schema(description ="视频文件")
|
||||
@NotNull(message = "视频文件不能为空")
|
||||
private FileInfoDto videoFile;
|
||||
|
||||
/**
|
||||
* 视频时长(秒)
|
||||
*/
|
||||
@Schema(description ="视频时长(秒)")
|
||||
@NotNull(message = "视频时长不能为空")
|
||||
private Integer videoMins;
|
||||
|
||||
/**
|
||||
* 上轴标记点每段时长(秒)
|
||||
*/
|
||||
@Schema(description ="上轴标记点每段时长(秒)")
|
||||
@NotNull(message = "上轴标记点每段时长不能为空")
|
||||
private Integer upTagPosition;
|
||||
|
||||
/**
|
||||
* 上轴标记点名称列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点名称列表")
|
||||
@NotEmpty(message = "上轴标记点名称不能为空")
|
||||
private List<BiaxVideoUpTagAddDTO> upTagList;
|
||||
|
||||
/**
|
||||
* 下轴轴标记点列表
|
||||
*/
|
||||
@Schema(description ="下轴轴标记点列表")
|
||||
@NotEmpty(message = "下轴轴标记点不能为空")
|
||||
private List<BiaxVideoDownTagAddDTO> downTagList;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 特色景观标签新增/编辑传输实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 特色景观标签新增/编辑传输实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="特色景观标签新增/编辑传输实体类")
|
||||
@Data
|
||||
public class FeatureTagDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 精选航线新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 精选航线新增实体类
|
||||
* @create 2024/7/18 15:40
|
||||
**/
|
||||
@Schema(description ="精选航线新增实体类")
|
||||
@Data
|
||||
public class FeaturedRouteAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description ="航线名称")
|
||||
@Size(max = 50, message = "航线名称长度超过50位")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 航线文件
|
||||
*/
|
||||
@Schema(description ="航线文件")
|
||||
private FileInfoDto routeFile;
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全景照片新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片新增实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片新增实体类")
|
||||
public class PanoramaPhotoAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@NotNull(message = "关联景点不能为空")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
@NotBlank(message = "照片名称不能为空")
|
||||
@Size(max = 128, message = "照片名称长度超过128位")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 标记列表
|
||||
*/
|
||||
@Schema(description ="标记列表")
|
||||
private List<PanoramaPhotoTagAddDTO> tagList;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description ="经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description ="纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全景照片特色景观标签新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片特色景观标签新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="全景照片特色景观标签新增实体类")
|
||||
@Data
|
||||
public class PanoramaPhotoFeatureTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
@NotBlank(message = "标签编码不能为空")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 全景照片ID
|
||||
*/
|
||||
@Schema(description ="全景照片ID")
|
||||
@NotNull(message = "全景照片ID不能为空")
|
||||
private Long panoramaPhotoId;
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 双轴视频分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="双轴视频分页查询类")
|
||||
@Data
|
||||
public class PanoramaPhotoPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全景照片新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片新增实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片新增实体类")
|
||||
public class PanoramaPhotoTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 照片文件
|
||||
*/
|
||||
@Schema(description ="照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全景照片标记更新实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片标记更新实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片标记更新实体类")
|
||||
public class PanoramaPhotoTagUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 照片文件
|
||||
*/
|
||||
@Schema(description ="照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全景照片更新实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片更新实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片更新实体类")
|
||||
public class PanoramaPhotoUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@NotNull(message = "关联景点不能为空")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
@NotBlank(message = "照片名称不能为空")
|
||||
@Size(max = 128, message = "照片名称长度超过128位")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 标记列表
|
||||
*/
|
||||
@Schema(description ="标记列表")
|
||||
private List<PanoramaPhotoTagUpdateDTO> tagList;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description ="经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description ="纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 热门景点批量新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点批量新增实体类
|
||||
* @create 2024/7/19 9:26
|
||||
**/
|
||||
@Schema(description ="热门景点批量新增实体类")
|
||||
@Data
|
||||
public class PopularScenicSpotAddBatchDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 景点ID列表
|
||||
*/
|
||||
@Schema(description ="景点ID列表")
|
||||
@NotEmpty(message = "景点集合不能为空")
|
||||
private List<Long> scenicSpotIdList;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 热门景点新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点新增实体类
|
||||
* @create 2024/7/19 9:26
|
||||
**/
|
||||
@Schema(description ="热门景点新增实体类")
|
||||
@Data
|
||||
public class PopularScenicSpotAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@NotNull(message = "景点ID不能为空")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 热门景点分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="热门景点分页查询类")
|
||||
@Data
|
||||
public class PopularScenicSpotPageQuery extends BasePage {
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 热门标签批量新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签批量新增实体类
|
||||
* @create 2024/7/19 9:26
|
||||
**/
|
||||
@Schema(description ="热门标签批量新增实体类")
|
||||
@Data
|
||||
public class PopularTagAddBatchDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码列表
|
||||
*/
|
||||
@Schema(description ="标签编码列表")
|
||||
@NotEmpty(message = "标签列表不能为空")
|
||||
private List<String> tagCodeList;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 热门标签新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签新增实体类
|
||||
* @create 2024/7/19 9:26
|
||||
**/
|
||||
@Schema(description ="热门标签新增实体类")
|
||||
@Data
|
||||
public class PopularTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
@NotBlank(message = "标签编码不能为空")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 热门标签分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="热门标签分页查询类")
|
||||
@Data
|
||||
public class PopularTagPageQuery extends BasePage {
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 景点分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="景点分页查询类")
|
||||
@Data
|
||||
public class RouteBasicPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 设备SN
|
||||
*/
|
||||
@Schema(description ="设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description =value = "航线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 创建航迹人Id
|
||||
*/
|
||||
@Schema(description =value = "创建航迹人Id,如果不传,则查询所有航迹,传了userId,则查询userId航迹")
|
||||
private Long userId;
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 景点新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点新增/编辑实体类")
|
||||
@Data
|
||||
public class ScenicSpotAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
@NotBlank(message = "景点名称不能为空")
|
||||
@Size(max = 128, message = "景点名称长度超过128位")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
@NotBlank(message = "景点等级不能为空")
|
||||
@Size(max = 50, message = "景点等级长度超过50位")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
@Schema(description ="机构编码")
|
||||
@NotBlank(message = "机构编码不能为空")
|
||||
@Size(max = 32, message = "机构编码长度超过32位")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 地址-省份编码
|
||||
*/
|
||||
@Schema(description ="地址-省份编码")
|
||||
@NotBlank(message = "省份编码不能为空")
|
||||
@Size(max = 32, message = "省份编码长度超过32位")
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地址-地市编码
|
||||
*/
|
||||
@Schema(description ="地址-地市编码")
|
||||
@Size(max = 32, message = "地市编码长度超过32位")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 地址-景区编码
|
||||
*/
|
||||
@Schema(description ="地址-景区编码")
|
||||
@Size(max = 32, message = "景区编码长度超过32位")
|
||||
private String scenicAreaCode;
|
||||
|
||||
/**
|
||||
* 标签编码集合
|
||||
*/
|
||||
@Schema(description ="标签编码集合")
|
||||
private List<String> tagCodeList;
|
||||
|
||||
/**
|
||||
* 关联设备SN
|
||||
*/
|
||||
@Schema(description ="关联设备SN")
|
||||
@NotBlank(message = "关联设备SN不能为空")
|
||||
@Size(max = 50, message = "关联设备SN长度超过50位")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 景点照片文件
|
||||
*/
|
||||
@Schema(description ="景点照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
|
||||
/**
|
||||
* 语音讲解文件
|
||||
*/
|
||||
@Schema(description ="语音讲解文件")
|
||||
private FileInfoDto introduceAudioFile;
|
||||
|
||||
/**
|
||||
* 虚拟飞行图片文件
|
||||
*/
|
||||
@Schema(description ="虚拟飞行图片文件")
|
||||
private FileInfoDto virtualFlyPhotoFile;
|
||||
|
||||
/**
|
||||
* 精选图片文件集合
|
||||
*/
|
||||
@Schema(description ="精选文件集合")
|
||||
private List<FileInfoDto> featuredPhotoFileList;
|
||||
|
||||
/**
|
||||
* 精选航线
|
||||
*/
|
||||
@Schema(description ="精选航线")
|
||||
private List<FeaturedRouteAddDTO> routeList;
|
||||
|
||||
/**
|
||||
* 热度
|
||||
*/
|
||||
@Schema(description ="热度")
|
||||
private BigDecimal hotScore;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description ="简介")
|
||||
@Size(max = 2000, message = "景区简介长度超过2000位")
|
||||
private String scenicSpotAbout;
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 景点新增/编辑实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点新增/编辑实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点新增/编辑实体类")
|
||||
@Data
|
||||
public class ScenicSpotAddOrUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
@NotBlank(message = "景点名称不能为空")
|
||||
@Size(max = 128, message = "景点名称长度超过128位")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
@NotBlank(message = "景点等级不能为空")
|
||||
@Size(max = 50, message = "景点等级长度超过50位")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 地址-省份
|
||||
*/
|
||||
@Schema(description ="地址-省份")
|
||||
@NotBlank(message = "省份不能为空")
|
||||
@Size(max = 128, message = "省份长度超过128位")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 地址-地市
|
||||
*/
|
||||
@Schema(description ="地址-地市")
|
||||
@NotBlank(message = "地市不能为空")
|
||||
@Size(max = 128, message = "地市长度超过128位")
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 地址-景区
|
||||
*/
|
||||
@Schema(description ="地址-景区")
|
||||
@NotBlank(message = "景区不能为空")
|
||||
@Size(max = 128, message = "景区长度超过50位")
|
||||
private String scenicArea;
|
||||
|
||||
/**
|
||||
* 标签ID集合
|
||||
*/
|
||||
@Schema(description ="标签ID集合")
|
||||
private List<Long> tagIdList;
|
||||
|
||||
/**
|
||||
* 精选图片集合
|
||||
*/
|
||||
@Schema(description ="精选图片集合")
|
||||
private List<FileInfoDto> featuredPhotoFileList;
|
||||
|
||||
/**
|
||||
* 精选航线
|
||||
*/
|
||||
@Schema(description ="精选航线")
|
||||
private List<FeaturedRouteAddDTO> routeList;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description ="简介")
|
||||
@Size(max = 2000, message = "景区简介长度超过2000位")
|
||||
private String scenicSpotAbout;
|
||||
|
||||
/**
|
||||
* 关联设备SN
|
||||
*/
|
||||
@Schema(description ="关联设备SN")
|
||||
@Size(max = 50, message = "关联设备SN长度超过50位")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description ="经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description ="纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
@Schema(description ="高度")
|
||||
private BigDecimal altitude;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 景点分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="景点分页查询类")
|
||||
@Data
|
||||
public class ScenicSpotPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 景点标签
|
||||
*/
|
||||
@Schema(description ="景点标签")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 景点新增/编辑实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点新增/编辑实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点新增/编辑实体类")
|
||||
@Data
|
||||
public class ScenicSpotUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
@NotBlank(message = "景点名称不能为空")
|
||||
@Size(max = 128, message = "景点名称长度超过128位")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
@NotBlank(message = "景点等级不能为空")
|
||||
@Size(max = 50, message = "景点等级长度超过50位")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
@Schema(description ="机构编码")
|
||||
@NotBlank(message = "机构编码不能为空")
|
||||
@Size(max = 32, message = "机构编码长度超过32位")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 地址-省份编码
|
||||
*/
|
||||
@Schema(description ="地址-省份编码")
|
||||
@NotBlank(message = "省份编码不能为空")
|
||||
@Size(max = 32, message = "省份编码长度超过32位")
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地址-地市编码
|
||||
*/
|
||||
@Schema(description ="地址-地市编码")
|
||||
@Size(max = 32, message = "地市编码长度超过32位")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 地址-景区编码
|
||||
*/
|
||||
@Schema(description ="地址-景区编码")
|
||||
@Size(max = 32, message = "景区编码长度超过32位")
|
||||
private String scenicAreaCode;
|
||||
|
||||
/**
|
||||
* 热度
|
||||
*/
|
||||
@Schema(description ="热度")
|
||||
private BigDecimal hotScore;
|
||||
|
||||
/**
|
||||
* 景点照片文件
|
||||
*/
|
||||
@Schema(description ="景点照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
|
||||
/**
|
||||
* 语音讲解文件
|
||||
*/
|
||||
@Schema(description ="语音讲解文件")
|
||||
private FileInfoDto introduceAudioFile;
|
||||
|
||||
/**
|
||||
* 虚拟飞行图片文件
|
||||
*/
|
||||
@Schema(description ="虚拟飞行图片文件")
|
||||
private FileInfoDto virtualFlyPhotoFile;
|
||||
|
||||
/**
|
||||
* 精选图片文件集合
|
||||
*/
|
||||
@Schema(description ="精选图片文件集合")
|
||||
private List<FileInfoDto> featuredPhotoFileList;
|
||||
|
||||
/**
|
||||
* 标签编码集合
|
||||
*/
|
||||
@Schema(description ="标签编码集合")
|
||||
private List<String> tagCodeList;
|
||||
|
||||
/**
|
||||
* 精选航线
|
||||
*/
|
||||
@Schema(description ="精选航线")
|
||||
private List<FeaturedRouteAddDTO> routeList;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description ="简介")
|
||||
@Size(max = 2000, message = "景区简介长度超过2000位")
|
||||
private String scenicSpotAbout;
|
||||
|
||||
/**
|
||||
* 关联设备SN
|
||||
*/
|
||||
@Schema(description ="关联设备SN")
|
||||
@Size(max = 50, message = "关联设备SN长度超过50位")
|
||||
private String deviceSn;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 主播新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 主播新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="主播新增实体类")
|
||||
@Data
|
||||
public class TourismStreamerAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description ="手机号")
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 主播分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 主播分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="主播分页查询类")
|
||||
@Data
|
||||
public class TourismStreamerPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description ="用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Schema(description ="真实姓名")
|
||||
private String realName;
|
||||
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description ="手机号")
|
||||
private String mobile;
|
||||
|
||||
|
||||
/**
|
||||
* 主播类型(1:主播,2:副播)
|
||||
*/
|
||||
@Schema(description ="主播类型(1:主播,2:副播)")
|
||||
private Integer streamerType;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 标签批量新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签批量新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="标签批量新增实体类")
|
||||
@Data
|
||||
public class TourismTagAddBatchDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 标签新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="标签新增实体类")
|
||||
@Data
|
||||
public class TourismTagAddDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
@NotBlank(message = "标签编码不能为空")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
@NotBlank(message = "标签名称不能为空")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 标签分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="标签分页查询类")
|
||||
@Data
|
||||
public class TourismTagPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 标签新增实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签新增实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="标签新增实体类")
|
||||
@Data
|
||||
public class TourismTagUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@TableField("tag_code")
|
||||
@NotBlank(message = "标签编码不能为空")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
@NotBlank(message = "标签名称不能为空")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件传输类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 文件传输类
|
||||
* @create 2024/8/12 15:27
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="文件传输类")
|
||||
public class UploadFileDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 文件
|
||||
*/
|
||||
@Schema(description ="文件")
|
||||
private List<MultipartFile> fileList;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.zlt.tourism.dto;
|
||||
|
||||
import com.zlt.tourism.core.BasePage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户分页查询类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 用户分页查询类
|
||||
* @create 2024/7/17 13:59
|
||||
**/
|
||||
@Schema(description ="用户分页查询类")
|
||||
@Data
|
||||
public class UserPageQuery extends BasePage {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description ="用户名")
|
||||
private String username;
|
||||
}
|
||||
+754
@@ -0,0 +1,754 @@
|
||||
package com.zlt.tourism.manager;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.central.common.utils.RSAUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.*;
|
||||
import com.zlt.tourism.dto.route.RouteDTO;
|
||||
import com.zlt.tourism.dto.route.WayPointDTO;
|
||||
import com.zlt.tourism.model.iking.IkDeviceEntity;
|
||||
import com.zlt.tourism.model.tourism.*;
|
||||
import com.zlt.tourism.service.*;
|
||||
import com.zlt.tourism.vo.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 双轴视频业务类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频业务类
|
||||
* @create 2024/7/18 16:15
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BiaxVideoManager {
|
||||
|
||||
/**
|
||||
* 双轴视频业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoService biaxVideoService;
|
||||
|
||||
/**
|
||||
* 双轴视频上轴标记业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoUpTagService biaxVideoUpTagService;
|
||||
|
||||
/**
|
||||
* 双轴视频下轴标记业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoDownTagService biaxVideoDownTagService;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 双轴视频特色景观标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoFeatureTagService featureTagService;
|
||||
|
||||
/**
|
||||
* 航线业务类
|
||||
*/
|
||||
@Resource
|
||||
private RouteManager routeManager;
|
||||
|
||||
/**
|
||||
* 标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismTagService tagService;
|
||||
|
||||
/**
|
||||
* 设备业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkDeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result add(BiaxVideoAddDTO model, Long userId) {
|
||||
BiaxVideoEntity entity = new BiaxVideoEntity();
|
||||
BeanUtil.copyProperties(model, entity, "videoFile", "videoMins", "upTagPosition");
|
||||
if (model.getVideoFile() != null && StrUtil.isNotEmpty(model.getVideoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(model.getVideoFile());
|
||||
entity.setVideoFile(photoFile);
|
||||
}
|
||||
Result upTagResult = validUpTag(model.getUpTagList());
|
||||
if(upTagResult.getFlag() == 1){
|
||||
return upTagResult;
|
||||
}
|
||||
if (validDuration(model.getVideoMins(), model.getUpTagPosition(), model.getUpTagList().size())) {
|
||||
return Result.failed("视频总时长校验未通过,请重新输入每段时长或修改上轴标记点数量!");
|
||||
}
|
||||
if (model.getDownTagList() != null && model.getDownTagList().size() > 0) {
|
||||
if (model.getDownTagList().size() > 6) {
|
||||
return Result.failed("下轴标记点最多只能配置6个!");
|
||||
}
|
||||
for (BiaxVideoDownTagAddDTO item : model.getDownTagList()) {
|
||||
if(StrUtil.isEmpty(item.getTagName())){
|
||||
return Result.failed("下轴标记点的名称不能为空!");
|
||||
}
|
||||
if(StrUtil.isEmpty(item.getTagPosition())){
|
||||
return Result.failed("下轴标记点的标记位置不能为空!");
|
||||
}
|
||||
if(!item.getTagPosition().contains(":")){
|
||||
return Result.failed("下轴标记点的标记位置【" + item.getTagPosition() + "】格式不正确!");
|
||||
}
|
||||
int tempSecond = formatSecond(item.getTagPosition());
|
||||
if(tempSecond > model.getUpTagPosition()){
|
||||
return Result.failed("下轴标记点位置有误,已超出每段时长,请重新输入!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(model.getRouteId() != null && model.getRouteId() > 0){
|
||||
List<WayPointDTO> wayPointList = routeManager.getPointListByRoutId(model.getRouteId());
|
||||
if(wayPointList != null && wayPointList.size() > 0){
|
||||
List<WayPointDTO> tmpList = wayPointList.stream().filter(o -> o.getLongitude() != null && new BigDecimal(o.getLongitude()).compareTo(BigDecimal.ZERO) > 0 && o.getLatitude() != null && new BigDecimal(o.getLatitude()).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||
if(tmpList != null && tmpList.size() > 0){
|
||||
WayPointDTO wayPointDTO = new WayPointDTO();
|
||||
if(tmpList.size() >= 2){
|
||||
wayPointDTO = tmpList.get(1);
|
||||
}else{
|
||||
wayPointDTO = tmpList.get(0);
|
||||
}
|
||||
entity.setLongitude(new BigDecimal(wayPointDTO.getLongitude()));
|
||||
entity.setLatitude(new BigDecimal(wayPointDTO.getLatitude()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getLongitude() == null || entity.getLatitude() == null){
|
||||
if(StrUtil.isNotEmpty(model.getDeviceSn())){
|
||||
IkDeviceEntity deviceEntity = deviceService.getByDeviceSn(model.getDeviceSn());
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
entity.setLongitude(deviceEntity.getLongitude());
|
||||
entity.setLatitude(deviceEntity.getLatitude());
|
||||
}
|
||||
}
|
||||
}
|
||||
entity.setVideoMins(formatTime(model.getVideoMins()));
|
||||
entity.setUpTagPosition(formatTime(model.getUpTagPosition()));
|
||||
entity.setCreateUserId(userId);
|
||||
entity.setUpdateUserId(userId);
|
||||
List<BiaxVideoEntity> existList = biaxVideoService.getListByScenicSpotId(entity.getScenicSpotId());
|
||||
if(existList != null && existList.size() > 0){
|
||||
for (BiaxVideoEntity item : existList) {
|
||||
item.setScenicSpotId(0L);
|
||||
}
|
||||
biaxVideoService.updateBatchById(existList);
|
||||
}
|
||||
boolean result = biaxVideoService.save(entity);
|
||||
if (result) {
|
||||
//新增上轴标记
|
||||
if (model.getUpTagList() != null && model.getUpTagList().size() > 0) {
|
||||
List<BiaxVideoUpTagEntity> upTagList = new ArrayList<>();
|
||||
BiaxVideoUpTagEntity upTagEntity;
|
||||
int orderNumber = 1;
|
||||
for (BiaxVideoUpTagAddDTO item : model.getUpTagList()) {
|
||||
upTagEntity = new BiaxVideoUpTagEntity();
|
||||
upTagEntity.setTagName(item.getTagName());
|
||||
upTagEntity.setBiaxVideoId(entity.getId());
|
||||
upTagEntity.setOrderNumber(orderNumber);
|
||||
orderNumber++;
|
||||
upTagList.add(upTagEntity);
|
||||
}
|
||||
biaxVideoUpTagService.saveBatch(upTagList);
|
||||
}
|
||||
//新增下轴标记
|
||||
if (model.getDownTagList() != null && model.getDownTagList().size() > 0) {
|
||||
List<BiaxVideoDownTagEntity> downTagList = new ArrayList<>();
|
||||
BiaxVideoDownTagEntity downTagEntity;
|
||||
int orderNumber = 1;
|
||||
for (BiaxVideoDownTagAddDTO item : model.getDownTagList()) {
|
||||
downTagEntity = new BiaxVideoDownTagEntity();
|
||||
BeanUtil.copyProperties(item, downTagEntity);
|
||||
if(item.getTagPosition().contains(":")){
|
||||
downTagEntity.setTagPosition(item.getTagPosition().replace(":", ":"));
|
||||
}
|
||||
downTagEntity.setBiaxVideoId(entity.getId());
|
||||
downTagEntity.setOrderNumber(orderNumber);
|
||||
orderNumber++;
|
||||
downTagList.add(downTagEntity);
|
||||
}
|
||||
biaxVideoDownTagService.saveBatch(downTagList);
|
||||
}
|
||||
//新增特色景观标签
|
||||
if(model.getFeatureTagCodeList() != null && model.getFeatureTagCodeList().size() > 0){
|
||||
List<BiaxVideoFeatureTagEntity> tagList = new ArrayList<>();
|
||||
BiaxVideoFeatureTagEntity tagEntity;
|
||||
for (String item : model.getFeatureTagCodeList()) {
|
||||
tagEntity = new BiaxVideoFeatureTagEntity();
|
||||
tagEntity.setBiaxVideoId(entity.getId());
|
||||
tagEntity.setTagCode(item);
|
||||
tagList.add(tagEntity);
|
||||
}
|
||||
featureTagService.saveBatch(tagList);
|
||||
}
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证下轴标记点
|
||||
* @param upTagList 下轴标记点
|
||||
* @return
|
||||
*/
|
||||
private Result validUpTag(List<BiaxVideoUpTagAddDTO> upTagList){
|
||||
if (upTagList == null || upTagList.size() == 0) {
|
||||
return Result.failed("请配置上轴标记点!");
|
||||
}
|
||||
if (upTagList.size() > 6) {
|
||||
return Result.failed("上轴标记点最多只能配置6个!");
|
||||
}
|
||||
boolean hasNullName = false;
|
||||
for (BiaxVideoUpTagAddDTO item : upTagList) {
|
||||
if(StrUtil.isEmpty(item.getTagName())){
|
||||
hasNullName = true;
|
||||
}
|
||||
}
|
||||
if(hasNullName){
|
||||
return Result.failed("上轴标记点的名称不能为空!");
|
||||
}
|
||||
return Result.succeed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断时长
|
||||
*
|
||||
* @param videoMins 视频时长
|
||||
* @param upTagPosition 每段时长
|
||||
* @param tagCount 标记数
|
||||
* @return
|
||||
*/
|
||||
private boolean validDuration(Integer videoMins, Integer upTagPosition, Integer tagCount) {
|
||||
Integer allTagPosition = upTagPosition * tagCount;
|
||||
if(videoMins >= (allTagPosition + 3) || videoMins <= (allTagPosition - 3)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 秒数转换成时间
|
||||
* @param seconds 秒数
|
||||
* @return
|
||||
*/
|
||||
private String formatTime(Integer seconds){
|
||||
String time = "00:00";
|
||||
if(seconds != null && seconds > 0){
|
||||
int hours = seconds / 3600;
|
||||
int minutes = (seconds % 3600) / 60;
|
||||
int remainingSeconds = seconds % 60;
|
||||
if(hours > 0){
|
||||
time = String.format("%02d:%02d:%02d", hours, minutes, remainingSeconds);
|
||||
}else {
|
||||
time = String.format("%02d:%02d", minutes, remainingSeconds);
|
||||
}
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间转换成秒数
|
||||
* @param time 时间
|
||||
* @return
|
||||
*/
|
||||
private int formatSecond(String time){
|
||||
int seconds = 0;
|
||||
if(StrUtil.isNotEmpty(time)){
|
||||
Long totalDuration = 0L;
|
||||
String[] videoDurationArray = time.split(":");
|
||||
if (videoDurationArray.length == 3) {
|
||||
totalDuration = TimeUnit.HOURS.toMillis(Integer.parseInt(videoDurationArray[0])) + TimeUnit.MINUTES.toMillis(Integer.parseInt(videoDurationArray[1])) + TimeUnit.SECONDS.toMillis(Integer.parseInt(videoDurationArray[2]));
|
||||
} else if (videoDurationArray.length == 2) {
|
||||
totalDuration = TimeUnit.MINUTES.toMillis(Integer.parseInt(videoDurationArray[0])) + TimeUnit.SECONDS.toMillis(Integer.parseInt(videoDurationArray[1]));
|
||||
}
|
||||
if (totalDuration > 0){
|
||||
seconds = totalDuration.intValue() / 1000;
|
||||
}
|
||||
}
|
||||
return seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户
|
||||
* @return
|
||||
*/
|
||||
public Result update(BiaxVideoUpdateDTO model, Long userId) {
|
||||
BiaxVideoEntity entity = new BiaxVideoEntity();
|
||||
BeanUtil.copyProperties(model, entity, "videoFile", "videoMins", "upTagPosition");
|
||||
if (model.getVideoFile() != null && StrUtil.isNotEmpty(model.getVideoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(model.getVideoFile());
|
||||
entity.setVideoFile(photoFile);
|
||||
}
|
||||
Result upTagResult = validUpTag(model.getUpTagList());
|
||||
if(upTagResult.getFlag() == 1){
|
||||
return upTagResult;
|
||||
}
|
||||
if (validDuration(model.getVideoMins(), model.getUpTagPosition(), model.getUpTagList().size())) {
|
||||
return Result.failed("视频总时长校验未通过,请重新输入每段时长或修改上轴标记点数量!");
|
||||
}
|
||||
if (model.getDownTagList() != null && model.getDownTagList().size() > 0) {
|
||||
if (model.getDownTagList().size() > 6) {
|
||||
return Result.failed("下轴标记点最多只能配置6个!");
|
||||
}
|
||||
for (BiaxVideoDownTagAddDTO item : model.getDownTagList()) {
|
||||
if(StrUtil.isEmpty(item.getTagName())){
|
||||
return Result.failed("下轴标记点的名称不能为空!");
|
||||
}
|
||||
if(StrUtil.isEmpty(item.getTagPosition())){
|
||||
return Result.failed("下轴标记点的标记位置不能为空!");
|
||||
}
|
||||
if(!item.getTagPosition().contains(":")){
|
||||
return Result.failed("下轴标记点的标记位置【" + item.getTagPosition() + "】格式不正确!");
|
||||
}
|
||||
int tempSecond = formatSecond(item.getTagPosition());
|
||||
if(tempSecond > model.getUpTagPosition()){
|
||||
return Result.failed("下轴标记点位置有误,已超出每段时长,请重新输入!");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return Result.failed("请配置下轴标记点!");
|
||||
}
|
||||
if(model.getRouteId() != null && model.getRouteId() > 0){
|
||||
List<WayPointDTO> wayPointList = routeManager.getPointListByRoutId(model.getRouteId());
|
||||
if(wayPointList != null && wayPointList.size() > 0){
|
||||
List<WayPointDTO> tmpList = wayPointList.stream().filter(o -> o.getLongitude() != null && new BigDecimal(o.getLongitude()).compareTo(BigDecimal.ZERO) > 0 && o.getLatitude() != null && new BigDecimal(o.getLatitude()).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||
if(tmpList != null && tmpList.size() > 0){
|
||||
WayPointDTO wayPointDTO = new WayPointDTO();
|
||||
if(tmpList.size() >= 2){
|
||||
wayPointDTO = tmpList.get(1);
|
||||
}else{
|
||||
wayPointDTO = tmpList.get(0);
|
||||
}
|
||||
entity.setLongitude(new BigDecimal(wayPointDTO.getLongitude()));
|
||||
entity.setLatitude(new BigDecimal(wayPointDTO.getLatitude()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getLongitude() == null || entity.getLatitude() == null){
|
||||
if(StrUtil.isNotEmpty(model.getDeviceSn())){
|
||||
IkDeviceEntity deviceEntity = deviceService.getByDeviceSn(model.getDeviceSn());
|
||||
if(deviceEntity != null && deviceEntity.getId() != null){
|
||||
entity.setLongitude(deviceEntity.getLongitude());
|
||||
entity.setLatitude(deviceEntity.getLatitude());
|
||||
}
|
||||
}
|
||||
}
|
||||
entity.setVideoMins(formatTime(model.getVideoMins()));
|
||||
entity.setUpTagPosition(formatTime(model.getUpTagPosition()));
|
||||
entity.setUpdateUserId(userId);
|
||||
List<BiaxVideoEntity> existList = biaxVideoService.getListByScenicSpotId(entity.getScenicSpotId());
|
||||
if(existList != null && existList.size() > 0){
|
||||
for (BiaxVideoEntity item : existList) {
|
||||
item.setScenicSpotId(0L);
|
||||
}
|
||||
biaxVideoService.updateBatchById(existList);
|
||||
}
|
||||
boolean result = biaxVideoService.updateById(entity);
|
||||
if (result) {
|
||||
//更新上轴标记
|
||||
updateUpTag(model.getId(), model.getUpTagList());
|
||||
//更新下轴标记
|
||||
updateDownTag(model.getId(), model.getDownTagList());
|
||||
//更新特色景观标签
|
||||
if(model.getFeatureTagCodeList() != null && model.getFeatureTagCodeList().size() > 0){
|
||||
updateFeatureTag(model.getId(), model.getFeatureTagCodeList());
|
||||
}
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特色景观标签
|
||||
* @param biaxVideoId 双轴视频ID
|
||||
* @param featureTagCodeList 特色景观列表
|
||||
*/
|
||||
private boolean updateFeatureTag(Long biaxVideoId, List<String> featureTagCodeList) {
|
||||
boolean result = false;
|
||||
if (biaxVideoId != null) {
|
||||
featureTagService.deleteByBiaxVideoId(biaxVideoId);
|
||||
if (featureTagCodeList != null && featureTagCodeList.size() > 0) {
|
||||
List<BiaxVideoFeatureTagEntity> list = new ArrayList<>(featureTagCodeList.size());
|
||||
BiaxVideoFeatureTagEntity model;
|
||||
for (String item : featureTagCodeList) {
|
||||
model = new BiaxVideoFeatureTagEntity();
|
||||
model.setTagCode(item);
|
||||
model.setBiaxVideoId(biaxVideoId);
|
||||
list.add(model);
|
||||
}
|
||||
result = featureTagService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新下轴标记
|
||||
*
|
||||
* @param biaxVideoId 双轴视频ID
|
||||
* @param downTagList 下轴标记列表
|
||||
*/
|
||||
private boolean updateDownTag(Long biaxVideoId, List<BiaxVideoDownTagAddDTO> downTagList) {
|
||||
boolean result = false;
|
||||
if (biaxVideoId != null) {
|
||||
biaxVideoDownTagService.deleteByBiaxVideoId(biaxVideoId);
|
||||
if (downTagList != null && downTagList.size() > 0) {
|
||||
List<BiaxVideoDownTagEntity> list = new ArrayList<>(downTagList.size());
|
||||
BiaxVideoDownTagEntity model;
|
||||
int orderNumber = 1;
|
||||
for (BiaxVideoDownTagAddDTO item : downTagList) {
|
||||
model = new BiaxVideoDownTagEntity();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if(item.getTagPosition().contains(":")){
|
||||
model.setTagPosition(item.getTagPosition().replace(":", ":"));
|
||||
}
|
||||
model.setBiaxVideoId(biaxVideoId);
|
||||
model.setOrderNumber(orderNumber);
|
||||
orderNumber++;
|
||||
list.add(model);
|
||||
}
|
||||
result = biaxVideoDownTagService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新上轴标记
|
||||
*
|
||||
* @param biaxVideoId 双轴视频ID
|
||||
* @param upTagNameList 上轴标记列表
|
||||
* @return
|
||||
*/
|
||||
private boolean updateUpTag(Long biaxVideoId, List<BiaxVideoUpTagAddDTO> upTagNameList) {
|
||||
boolean result = false;
|
||||
if (biaxVideoId != null) {
|
||||
biaxVideoUpTagService.deleteByBiaxVideoId(biaxVideoId);
|
||||
if (upTagNameList != null && upTagNameList.size() > 0) {
|
||||
List<BiaxVideoUpTagEntity> list = new ArrayList<>(upTagNameList.size());
|
||||
BiaxVideoUpTagEntity model;
|
||||
int orderNumber = 1;
|
||||
for (BiaxVideoUpTagAddDTO item : upTagNameList) {
|
||||
model = new BiaxVideoUpTagEntity();
|
||||
model.setTagName(item.getTagName());
|
||||
model.setBiaxVideoId(biaxVideoId);
|
||||
model.setOrderNumber(orderNumber);
|
||||
orderNumber++;
|
||||
list.add(model);
|
||||
}
|
||||
result = biaxVideoUpTagService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<BiaxVideoPageVO> selectPageList(BiaxVideoPageQuery query) {
|
||||
LambdaQueryWrapper<BiaxVideoEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.like(StrUtil.isNotEmpty(query.getBiaxVideoName()), BiaxVideoEntity::getBiaxVideoName, query.getBiaxVideoName());
|
||||
qw.orderByDesc(BiaxVideoEntity::getCreatedAt);
|
||||
PageInfo<BiaxVideoEntity> tagPageList = biaxVideoService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<BiaxVideoPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(tagPageList, pageList);
|
||||
if (tagPageList.getList() != null && tagPageList.getList().size() > 0) {
|
||||
List<BiaxVideoEntity> list = tagPageList.getList();
|
||||
List<BiaxVideoPageVO> voList = new ArrayList<>(list.size());
|
||||
for (BiaxVideoEntity item : list) {
|
||||
BiaxVideoPageVO model = doToPageVO(item);
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实体转分页实体
|
||||
*
|
||||
* @param item 实体
|
||||
* @return
|
||||
*/
|
||||
private BiaxVideoPageVO doToPageVO(BiaxVideoEntity item) {
|
||||
BiaxVideoPageVO model = new BiaxVideoPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if (item.getScenicSpotId() != null) {
|
||||
ScenicSpotEntity scenicSpotEntity = scenicSpotService.getById(item.getScenicSpotId());
|
||||
if (scenicSpotEntity != null && StrUtil.isNotEmpty(scenicSpotEntity.getScenicSpotName())) {
|
||||
String scenicSpotName = scenicSpotEntity.getScenicSpotName();
|
||||
model.setScenicSpotName(scenicSpotName);
|
||||
}
|
||||
}
|
||||
List<BiaxVideoUpTagEntity> biaxVideoUpTagList = biaxVideoUpTagService.getListByBiaxVideoId(item.getId());
|
||||
if (biaxVideoUpTagList != null && biaxVideoUpTagList.size() > 0) {
|
||||
List<String> upTagList = biaxVideoUpTagList.stream().filter(o -> StrUtil.isNotEmpty(o.getTagName())).map(BiaxVideoUpTagEntity::getTagName).collect(Collectors.toList());
|
||||
model.setUpTagNameList(upTagList);
|
||||
}
|
||||
List<BiaxVideoDownTagEntity> biaxVideoDownTagList = biaxVideoDownTagService.getByBiaxVideoId(item.getId());
|
||||
if (biaxVideoDownTagList != null && biaxVideoDownTagList.size() > 0) {
|
||||
List<String> downTagNameList = biaxVideoDownTagList.stream().filter(o -> StrUtil.isNotEmpty(o.getTagName())).map(BiaxVideoDownTagEntity::getTagName).collect(Collectors.toList());
|
||||
model.setDownTagNameList(downTagNameList);
|
||||
}
|
||||
if (model.getRouteId() != null) {
|
||||
RouteDTO routeDTO = routeManager.getById(item.getRouteId());
|
||||
if (routeDTO != null && routeDTO.getRouteRunNum() != null) {
|
||||
if (StrUtil.isNotEmpty(routeDTO.getRouteName())) {
|
||||
String routeName = RSAUtil.decryptOne(routeDTO.getRouteName());
|
||||
model.setRouteName(routeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID删除记录
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
public Result delete(Long id) {
|
||||
if (id != null) {
|
||||
boolean result = biaxVideoService.removeById(id);
|
||||
if (result) {
|
||||
biaxVideoUpTagService.deleteByBiaxVideoId(id);
|
||||
biaxVideoDownTagService.deleteByBiaxVideoId(id);
|
||||
featureTagService.deleteByBiaxVideoId(id);
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("主键ID为空,操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取详情
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
public BiaxVideoVO getEntity(Long id) {
|
||||
BiaxVideoVO model = new BiaxVideoVO();
|
||||
BiaxVideoEntity entity = biaxVideoService.getById(id);
|
||||
if (entity != null && entity.getId() != null) {
|
||||
BeanUtil.copyProperties(entity, model, "videoFile", "videoMins", "upTagPosition");
|
||||
if (StrUtil.isNotEmpty(entity.getVideoFile())) {
|
||||
JSONObject json = JSONObject.parseObject(entity.getVideoFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
model.setVideoFile(fileInfoDto);
|
||||
}
|
||||
model.setVideoMins(formatSecond(entity.getVideoMins()));
|
||||
model.setUpTagPosition(formatSecond(entity.getUpTagPosition()));
|
||||
List<BiaxVideoUpTagEntity> biaxVideoUpTagList = biaxVideoUpTagService.getListByBiaxVideoId(id);
|
||||
if (biaxVideoUpTagList != null && biaxVideoUpTagList.size() > 0) {
|
||||
List<BiaxVideoUpTagVO> upTagList = new ArrayList<>(biaxVideoUpTagList.size());
|
||||
BiaxVideoUpTagVO upTagVO;
|
||||
for (BiaxVideoUpTagEntity item : biaxVideoUpTagList) {
|
||||
upTagVO = new BiaxVideoUpTagVO();
|
||||
BeanUtil.copyProperties(item, upTagVO);
|
||||
upTagList.add(upTagVO);
|
||||
}
|
||||
model.setUpTagList(upTagList);
|
||||
}
|
||||
List<BiaxVideoDownTagEntity> biaxVideoDownTagList = biaxVideoDownTagService.getByBiaxVideoId(id);
|
||||
if (biaxVideoDownTagList != null && biaxVideoDownTagList.size() > 0) {
|
||||
List<BiaxVideoDownTagVO> downTagList = new ArrayList<>(biaxVideoDownTagList.size());
|
||||
BiaxVideoDownTagVO downTagVO;
|
||||
for (BiaxVideoDownTagEntity item : biaxVideoDownTagList) {
|
||||
downTagVO = new BiaxVideoDownTagVO();
|
||||
BeanUtil.copyProperties(item, downTagVO);
|
||||
if(item.getTagPosition().contains(":")){
|
||||
downTagVO.setTagPosition(item.getTagPosition().replace(":", ":"));
|
||||
}
|
||||
downTagList.add(downTagVO);
|
||||
}
|
||||
model.setDownTagList(downTagList);
|
||||
}
|
||||
List<BiaxVideoFeatureTagEntity> featureTagList = featureTagService.getListByBiaxVideoId(id);
|
||||
if(featureTagList != null && featureTagList.size() > 0){
|
||||
List<String> tagCodeList = featureTagList.stream().map(BiaxVideoFeatureTagEntity::getTagCode).collect(Collectors.toList());
|
||||
model.setFeatureTagCodeList(tagCodeList);
|
||||
}
|
||||
if(entity.getRouteId() != null){
|
||||
RouteDTO routeDTO = routeManager.getById(entity.getRouteId());
|
||||
if (routeDTO != null && routeDTO.getRouteRunNum() != null) {
|
||||
if (StrUtil.isNotEmpty(routeDTO.getRouteName())) {
|
||||
String routeName = RSAUtil.decryptOne(routeDTO.getRouteName());
|
||||
model.setRouteName(routeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增下轴标记点
|
||||
*
|
||||
* @param model 下轴标记点
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result addDownTag(BiaxVideoDownTagListAddDTO model, Long userId) {
|
||||
BiaxVideoEntity entity = biaxVideoService.getById(model.getId());
|
||||
if (entity == null || entity.getId() == null) {
|
||||
return Result.failed("请先配置基础信息和上轴标记点!");
|
||||
}
|
||||
if (model.getDownTagList() == null || model.getDownTagList().size() == 0) {
|
||||
return Result.failed("请配置下轴标记点!");
|
||||
}
|
||||
if (model.getDownTagList().size() > 6) {
|
||||
return Result.failed("下轴标记点最多只能配置6个!");
|
||||
}
|
||||
//更新下轴标记
|
||||
boolean result = updateDownTag(model.getId(), model.getDownTagList());
|
||||
if (result) {
|
||||
entity.setUpdateUserId(userId);
|
||||
entity.setUpdatedAt(new Date());
|
||||
biaxVideoService.updateById(entity);
|
||||
}
|
||||
return result ? Result.succeed() : Result.failed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新基础信息
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result updateBasicInfo(BiaxVideoBasicUpdateDTO model, Long userId) {
|
||||
BiaxVideoEntity entity = new BiaxVideoEntity();
|
||||
BeanUtil.copyProperties(model, entity, "videoFile", "videoMins", "upTagPosition");
|
||||
if (model.getVideoFile() != null && StrUtil.isNotEmpty(model.getVideoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(model.getVideoFile());
|
||||
entity.setVideoFile(photoFile);
|
||||
}
|
||||
if (model.getUpTagList() == null || model.getUpTagList().size() == 0) {
|
||||
return Result.failed("请配置上轴标记点!");
|
||||
}
|
||||
if (model.getUpTagList().size() > 6) {
|
||||
return Result.failed("上轴标记点最多只能配置6个!");
|
||||
}
|
||||
if (validDuration(model.getVideoMins(), model.getUpTagPosition(), model.getUpTagList().size())) {
|
||||
return Result.failed("视频总时长校验未通过,请重新输入每段时长或修改上轴标记点数量!");
|
||||
}
|
||||
entity.setVideoMins(formatTime(model.getVideoMins()));
|
||||
entity.setUpTagPosition(formatTime(model.getUpTagPosition()));
|
||||
entity.setUpdateUserId(userId);
|
||||
boolean result = biaxVideoService.updateById(entity);
|
||||
if (result) {
|
||||
//更新上轴标记
|
||||
updateUpTag(model.getId(), model.getUpTagList());
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增基础信息和上轴标记点
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result addBasicInfo(BiaxVideoBasicAddDTO model, Long userId) {
|
||||
BiaxVideoEntity entity = new BiaxVideoEntity();
|
||||
BeanUtil.copyProperties(model, entity, "videoFile", "videoMins", "upTagPosition");
|
||||
if (model.getVideoFile() != null && StrUtil.isNotEmpty(model.getVideoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(model.getVideoFile());
|
||||
entity.setVideoFile(photoFile);
|
||||
}
|
||||
if (model.getUpTagList() == null || model.getUpTagList().size() == 0) {
|
||||
return Result.failed("请配置上轴标记点!");
|
||||
}
|
||||
if (model.getUpTagList().size() > 6) {
|
||||
return Result.failed("上轴标记点最多只能配置6个!");
|
||||
}
|
||||
if (validDuration(model.getVideoMins(), model.getUpTagPosition(), model.getUpTagList().size())) {
|
||||
return Result.failed("视频总时长校验未通过,请重新输入每段时长或修改上轴标记点数量!");
|
||||
}
|
||||
entity.setVideoMins(formatTime(model.getVideoMins()));
|
||||
entity.setUpTagPosition(formatTime(model.getUpTagPosition()));
|
||||
entity.setCreateUserId(userId);
|
||||
entity.setUpdateUserId(userId);
|
||||
boolean result = biaxVideoService.save(entity);
|
||||
if (result) {
|
||||
//新增上轴标记
|
||||
if (model.getUpTagList() != null && model.getUpTagList().size() > 0) {
|
||||
List<BiaxVideoUpTagEntity> upTagList = new ArrayList<>();
|
||||
BiaxVideoUpTagEntity upTagEntity;
|
||||
int orderNumber = 1;
|
||||
for (BiaxVideoUpTagAddDTO item : model.getUpTagList()) {
|
||||
upTagEntity = new BiaxVideoUpTagEntity();
|
||||
upTagEntity.setTagName(item.getTagName());
|
||||
upTagEntity.setBiaxVideoId(entity.getId());
|
||||
upTagEntity.setOrderNumber(orderNumber);
|
||||
orderNumber++;
|
||||
upTagList.add(upTagEntity);
|
||||
}
|
||||
biaxVideoUpTagService.saveBatch(upTagList);
|
||||
}
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断景点是否已绑定双轴视频
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
public boolean existScenicSpot(Long scenicSpotId, Long biaxVideoId) {
|
||||
LambdaQueryWrapper<BiaxVideoEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(BiaxVideoEntity::getScenicSpotId, scenicSpotId);
|
||||
if(biaxVideoId != null){
|
||||
qw.ne(BiaxVideoEntity::getId, biaxVideoId);
|
||||
}
|
||||
long count = biaxVideoService.count(qw);
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
+354
@@ -0,0 +1,354 @@
|
||||
package com.zlt.tourism.manager;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.*;
|
||||
import com.zlt.tourism.model.tourism.PanoramaPhotoEntity;
|
||||
import com.zlt.tourism.model.tourism.PanoramaPhotoFeatureTagEntity;
|
||||
import com.zlt.tourism.model.tourism.PanoramaPhotoTagEntity;
|
||||
import com.zlt.tourism.model.tourism.ScenicSpotEntity;
|
||||
import com.zlt.tourism.service.PanoramaPhotoFeatureTagService;
|
||||
import com.zlt.tourism.service.PanoramaPhotoService;
|
||||
import com.zlt.tourism.service.PanoramaPhotoTagService;
|
||||
import com.zlt.tourism.service.ScenicSpotService;
|
||||
import com.zlt.tourism.vo.PanoramaPhotoPageVO;
|
||||
import com.zlt.tourism.vo.PanoramaPhotoTagVO;
|
||||
import com.zlt.tourism.vo.PanoramaPhotoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片业务类
|
||||
* @create 2024/7/18 17:37
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PanoramaPhotoManager {
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoService panoramaPhotoService;
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoTagService panoramaPhotoTagService;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 全景照片特色景观标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoFeatureTagService featureTagService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
|
||||
public Result add(PanoramaPhotoAddDTO model, Long userId) {
|
||||
PanoramaPhotoEntity entity = new PanoramaPhotoEntity();
|
||||
BeanUtil.copyProperties(model, entity);
|
||||
if (model.getLongitude() != null && model.getLongitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
entity.setLongitude(model.getLongitude().add(new BigDecimal(180)));
|
||||
}
|
||||
if (model.getLatitude() != null && model.getLatitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
entity.setLatitude(model.getLatitude().add(new BigDecimal(90)));
|
||||
}
|
||||
entity.setCreateUserId(userId);
|
||||
entity.setUpdateUserId(userId);
|
||||
List<PanoramaPhotoEntity> existList = panoramaPhotoService.getListByScenicSpotId(entity.getScenicSpotId());
|
||||
if(existList != null && existList.size() > 0){
|
||||
for (PanoramaPhotoEntity item : existList) {
|
||||
item.setScenicSpotId(0L);
|
||||
}
|
||||
panoramaPhotoService.updateBatchById(existList);
|
||||
}
|
||||
boolean result = panoramaPhotoService.save(entity);
|
||||
if (result) {
|
||||
//新增标记
|
||||
if (model.getTagList() != null && model.getTagList().size() > 0) {
|
||||
List<PanoramaPhotoTagEntity> tagList = new ArrayList<>(model.getTagList().size());
|
||||
PanoramaPhotoTagEntity tagEntity;
|
||||
for (PanoramaPhotoTagAddDTO item : model.getTagList()) {
|
||||
tagEntity = new PanoramaPhotoTagEntity();
|
||||
BeanUtil.copyProperties(item, tagEntity, "photoFile");
|
||||
if (item.getPhotoFile() != null && StrUtil.isNotEmpty(item.getPhotoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(item.getPhotoFile());
|
||||
tagEntity.setPhotoFile(photoFile);
|
||||
}
|
||||
tagEntity.setPanoramaPhotoId(entity.getId());
|
||||
tagList.add(tagEntity);
|
||||
}
|
||||
panoramaPhotoTagService.saveBatch(tagList);
|
||||
}
|
||||
//新增特色景观标签
|
||||
if (model.getFeatureTagCodeList() != null && model.getFeatureTagCodeList().size() > 0) {
|
||||
List<PanoramaPhotoFeatureTagEntity> tagList = new ArrayList<>();
|
||||
PanoramaPhotoFeatureTagEntity tagEntity;
|
||||
for (String item : model.getFeatureTagCodeList()) {
|
||||
tagEntity = new PanoramaPhotoFeatureTagEntity();
|
||||
tagEntity.setPanoramaPhotoId(entity.getId());
|
||||
tagEntity.setTagCode(item);
|
||||
tagList.add(tagEntity);
|
||||
}
|
||||
featureTagService.saveBatch(tagList);
|
||||
}
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param model 实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result update(PanoramaPhotoUpdateDTO model, Long userId) {
|
||||
PanoramaPhotoEntity entity = new PanoramaPhotoEntity();
|
||||
BeanUtil.copyProperties(model, entity);
|
||||
if (model.getLongitude() != null && model.getLongitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
entity.setLongitude(model.getLongitude().add(new BigDecimal(180)));
|
||||
}
|
||||
if (model.getLatitude() != null && model.getLatitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
entity.setLatitude(model.getLatitude().add(new BigDecimal(90)));
|
||||
}
|
||||
entity.setUpdateUserId(userId);
|
||||
List<PanoramaPhotoEntity> existList = panoramaPhotoService.getListByScenicSpotId(entity.getScenicSpotId());
|
||||
if(existList != null && existList.size() > 0){
|
||||
for (PanoramaPhotoEntity item : existList) {
|
||||
item.setScenicSpotId(0L);
|
||||
}
|
||||
panoramaPhotoService.updateBatchById(existList);
|
||||
}
|
||||
boolean result = panoramaPhotoService.updateById(entity);
|
||||
if (result) {
|
||||
//更新标记
|
||||
updateUpTag(model.getId(), model.getTagList());
|
||||
//更新特色景观标签
|
||||
if (model.getFeatureTagCodeList() != null && model.getFeatureTagCodeList().size() > 0) {
|
||||
updateFeatureTag(model.getId(), model.getFeatureTagCodeList());
|
||||
}
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特色景观标签
|
||||
*
|
||||
* @param panoramaPhotoId 双轴视频ID
|
||||
* @param featureTagCodeList 特色景观列表
|
||||
*/
|
||||
private boolean updateFeatureTag(Long panoramaPhotoId, List<String> featureTagCodeList) {
|
||||
boolean result = false;
|
||||
if (panoramaPhotoId != null) {
|
||||
featureTagService.deleteByPanoramaPhotoId(panoramaPhotoId);
|
||||
if (featureTagCodeList != null && featureTagCodeList.size() > 0) {
|
||||
List<PanoramaPhotoFeatureTagEntity> list = new ArrayList<>(featureTagCodeList.size());
|
||||
PanoramaPhotoFeatureTagEntity model;
|
||||
for (String item : featureTagCodeList) {
|
||||
model = new PanoramaPhotoFeatureTagEntity();
|
||||
model.setTagCode(item);
|
||||
model.setPanoramaPhotoId(panoramaPhotoId);
|
||||
list.add(model);
|
||||
}
|
||||
result = featureTagService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新标记
|
||||
*
|
||||
* @param panoramaPhotoId 全景照片ID
|
||||
* @param tagNameList 标签名称列表
|
||||
*/
|
||||
private boolean updateUpTag(Long panoramaPhotoId, List<PanoramaPhotoTagUpdateDTO> tagNameList) {
|
||||
boolean result = false;
|
||||
if (panoramaPhotoId != null) {
|
||||
panoramaPhotoTagService.deleteByPanoramaPhotoId(panoramaPhotoId);
|
||||
if (tagNameList != null && tagNameList.size() > 0) {
|
||||
List<PanoramaPhotoTagEntity> list = new ArrayList<>(tagNameList.size());
|
||||
PanoramaPhotoTagEntity model;
|
||||
for (PanoramaPhotoTagUpdateDTO item : tagNameList) {
|
||||
model = new PanoramaPhotoTagEntity();
|
||||
BeanUtil.copyProperties(item, model, "photoFile");
|
||||
if (item.getPhotoFile() != null && StrUtil.isNotEmpty(item.getPhotoFile().getUrl())) {
|
||||
String photoFile = JSONObject.toJSONString(item.getPhotoFile());
|
||||
model.setPhotoFile(photoFile);
|
||||
}
|
||||
model.setPanoramaPhotoId(panoramaPhotoId);
|
||||
list.add(model);
|
||||
}
|
||||
result = panoramaPhotoTagService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID删除记录
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
public Result delete(Long id) {
|
||||
if (id != null) {
|
||||
boolean result = panoramaPhotoService.removeById(id);
|
||||
if (result) {
|
||||
panoramaPhotoTagService.deleteByPanoramaPhotoId(id);
|
||||
featureTagService.deleteByPanoramaPhotoId(id);
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("主键ID为空,操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<PanoramaPhotoPageVO> selectPageList(PanoramaPhotoPageQuery query) {
|
||||
LambdaQueryWrapper<PanoramaPhotoEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.like(StrUtil.isNotEmpty(query.getPhotoName()), PanoramaPhotoEntity::getPhotoName, query.getPhotoName());
|
||||
qw.orderByDesc(PanoramaPhotoEntity::getCreatedAt);
|
||||
PageInfo<PanoramaPhotoEntity> tagPageList = panoramaPhotoService.selectPageList(query.getPager(), qw);
|
||||
PageInfo<PanoramaPhotoPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(tagPageList, pageList);
|
||||
if (tagPageList.getList() != null && tagPageList.getList().size() > 0) {
|
||||
List<PanoramaPhotoEntity> list = tagPageList.getList();
|
||||
List<PanoramaPhotoPageVO> voList = new ArrayList<>(list.size());
|
||||
for (PanoramaPhotoEntity item : list) {
|
||||
PanoramaPhotoPageVO model = doToPageVO(item);
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实体转分页实体
|
||||
*
|
||||
* @param item 实体
|
||||
* @return
|
||||
*/
|
||||
private PanoramaPhotoPageVO doToPageVO(PanoramaPhotoEntity item) {
|
||||
PanoramaPhotoPageVO model = new PanoramaPhotoPageVO();
|
||||
BeanUtil.copyProperties(item, model);
|
||||
if (item.getScenicSpotId() != null) {
|
||||
ScenicSpotEntity scenicSpotEntity = scenicSpotService.getById(item.getScenicSpotId());
|
||||
if (scenicSpotEntity != null && StrUtil.isNotEmpty(scenicSpotEntity.getScenicSpotName())) {
|
||||
String scenicSpotName = scenicSpotEntity.getScenicSpotName();
|
||||
model.setScenicSpotName(scenicSpotName);
|
||||
}
|
||||
}
|
||||
List<PanoramaPhotoTagEntity> tagList = panoramaPhotoTagService.getListByPanoramaPhotoId(item.getId());
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
List<String> tagNameList = tagList.stream().filter(o -> StrUtil.isNotEmpty(o.getTagName())).map(PanoramaPhotoTagEntity::getTagName).collect(Collectors.toList());
|
||||
model.setTagNameList(tagNameList);
|
||||
}
|
||||
if (item.getLongitude() != null && item.getLongitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
model.setLongitude(item.getLongitude().subtract(new BigDecimal(180)));
|
||||
}
|
||||
if (item.getLatitude() != null && item.getLatitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
model.setLatitude(item.getLatitude().subtract(new BigDecimal(90)));
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取记录
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
public PanoramaPhotoVO getEntity(Long id) {
|
||||
PanoramaPhotoVO model = new PanoramaPhotoVO();
|
||||
PanoramaPhotoEntity entity = panoramaPhotoService.getById(id);
|
||||
if (entity != null && entity.getId() != null) {
|
||||
BeanUtil.copyProperties(entity, model);
|
||||
List<PanoramaPhotoTagEntity> tagList = panoramaPhotoTagService.getListByPanoramaPhotoId(id);
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
List<PanoramaPhotoTagVO> tagVOList = new ArrayList<>();
|
||||
PanoramaPhotoTagVO tagVO;
|
||||
for (PanoramaPhotoTagEntity item : tagList) {
|
||||
tagVO = new PanoramaPhotoTagVO();
|
||||
BeanUtil.copyProperties(item, tagVO, "photoFile");
|
||||
if (StrUtil.isNotEmpty(item.getPhotoFile())) {
|
||||
JSONObject json = JSONObject.parseObject(item.getPhotoFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
tagVO.setPhotoFile(fileInfoDto);
|
||||
}
|
||||
tagVOList.add(tagVO);
|
||||
}
|
||||
model.setTagList(tagVOList);
|
||||
}
|
||||
List<PanoramaPhotoFeatureTagEntity> featureTagList = featureTagService.getListByPanoramaPhotoId(id);
|
||||
if (featureTagList != null && featureTagList.size() > 0) {
|
||||
List<String> tagCodeList = featureTagList.stream().map(PanoramaPhotoFeatureTagEntity::getTagCode).collect(Collectors.toList());
|
||||
model.setFeatureTagCodeList(tagCodeList);
|
||||
}
|
||||
if (entity.getLongitude() != null && entity.getLongitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
model.setLongitude(entity.getLongitude().subtract(new BigDecimal(180)));
|
||||
}
|
||||
if (entity.getLatitude() != null && entity.getLatitude().compareTo(BigDecimal.ZERO) > 0) {
|
||||
model.setLatitude(entity.getLatitude().subtract(new BigDecimal(90)));
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断景点是否已绑定全景照片
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @return
|
||||
*/
|
||||
public boolean existScenicSpot(Long scenicSpotId, Long panoramaPhotoId) {
|
||||
LambdaQueryWrapper<PanoramaPhotoEntity> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(PanoramaPhotoEntity::getScenicSpotId, scenicSpotId);
|
||||
if(panoramaPhotoId != null){
|
||||
qw.ne(PanoramaPhotoEntity::getId, panoramaPhotoId);
|
||||
}
|
||||
long count = panoramaPhotoService.count(qw);
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
+682
@@ -0,0 +1,682 @@
|
||||
package com.zlt.tourism.manager;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.central.common.utils.RSAUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zlt.tourism.dto.*;
|
||||
import com.zlt.tourism.dto.org.OrganizationDTO;
|
||||
import com.zlt.tourism.dto.route.RouteDTO;
|
||||
import com.zlt.tourism.model.iking.IkDeviceEntity;
|
||||
import com.zlt.tourism.model.tourism.*;
|
||||
import com.zlt.tourism.service.*;
|
||||
import com.zlt.tourism.vo.FeaturedRouteVO;
|
||||
import com.zlt.tourism.vo.ScenicSpotPageVO;
|
||||
import com.zlt.tourism.vo.ScenicSpotVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点业务类
|
||||
* @create 2024/7/18 13:19
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ScenicSpotManager {
|
||||
|
||||
/**
|
||||
* 景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotService scenicSpotService;
|
||||
|
||||
/**
|
||||
* 景点标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotTagService scenicSpotTagService;
|
||||
|
||||
/**
|
||||
* 精选图片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private FeaturedPhotoService featuredPhotoService;
|
||||
|
||||
/**
|
||||
* 景点设备关系业务类
|
||||
*/
|
||||
@Autowired
|
||||
private ScenicSpotDeviceService scenicSpotDeviceService;
|
||||
|
||||
/**
|
||||
* 标签业务类
|
||||
*/
|
||||
@Autowired
|
||||
private TourismTagService tagService;
|
||||
|
||||
/**
|
||||
* 精选航线业务类
|
||||
*/
|
||||
@Autowired
|
||||
private FeaturedRouteService featuredRouteService;
|
||||
|
||||
/**
|
||||
* 热门景点业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PopularScenicSpotService popularScenicSpotService;
|
||||
|
||||
/**
|
||||
* 我的收藏业务类
|
||||
*/
|
||||
@Autowired
|
||||
private MyFavoriteService myFavoriteService;
|
||||
|
||||
/**
|
||||
* 双轴视频业务类
|
||||
*/
|
||||
@Autowired
|
||||
private BiaxVideoService biaxVideoService;
|
||||
|
||||
/**
|
||||
* 全景照片业务类
|
||||
*/
|
||||
@Autowired
|
||||
private PanoramaPhotoService panoramaPhotoService;
|
||||
|
||||
/**
|
||||
* 设备业务类
|
||||
*/
|
||||
@Autowired
|
||||
private IkDeviceService ikDeviceService;
|
||||
|
||||
/**
|
||||
* 航线业务类
|
||||
*/
|
||||
@Resource
|
||||
private RouteManager routeManager;
|
||||
|
||||
/**
|
||||
* 机构业务类
|
||||
*/
|
||||
@Autowired
|
||||
private OrganizationManager organizationManager;
|
||||
|
||||
/**
|
||||
* 更新航线
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @param routeList 航线列表
|
||||
* @param isUpdate 是否新增
|
||||
* @return
|
||||
*/
|
||||
private boolean updateRoute(Long scenicSpotId, List<FeaturedRouteAddDTO> routeList, boolean isUpdate) {
|
||||
boolean result = false;
|
||||
if (scenicSpotId != null) {
|
||||
if (isUpdate) {
|
||||
//先删除
|
||||
featuredRouteService.deleteByScenicSpotId(scenicSpotId);
|
||||
}
|
||||
if (routeList != null && routeList.size() > 0) {
|
||||
List<FeaturedRouteEntity> featuredRouteList = new ArrayList<>();
|
||||
List<String> routeIdList = new ArrayList<>();
|
||||
FeaturedRouteEntity featuredRouteEntity;
|
||||
int orderNumber = 1;
|
||||
for (FeaturedRouteAddDTO item : routeList) {
|
||||
if(item.getRouteId() != null){
|
||||
if(!routeIdList.contains(item.getRouteId().toString())){
|
||||
featuredRouteEntity = new FeaturedRouteEntity();
|
||||
if(item.getRouteFile() != null && StrUtil.isNotEmpty(item.getRouteFile().getUrl())){
|
||||
featuredRouteEntity.setRouteFile(JSONObject.toJSONString(item.getRouteFile()));
|
||||
}
|
||||
featuredRouteEntity.setScenicSpotId(scenicSpotId);
|
||||
featuredRouteEntity.setRouteId(item.getRouteId());
|
||||
featuredRouteEntity.setRouteName(item.getRouteName());
|
||||
featuredRouteEntity.setOrderNumber(orderNumber);
|
||||
featuredRouteList.add(featuredRouteEntity);
|
||||
orderNumber++;
|
||||
routeIdList.add(item.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
result = featuredRouteService.saveBatch(featuredRouteList);
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新景点标签
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @param tagCodeList 标签编码集合
|
||||
* @param isUpdate 是否是更新
|
||||
* @return
|
||||
*/
|
||||
private boolean updateTag(Long scenicSpotId, List<String> tagCodeList, boolean isUpdate) {
|
||||
boolean result = false;
|
||||
if (scenicSpotId != null) {
|
||||
if (isUpdate) {
|
||||
//先删除
|
||||
scenicSpotTagService.deleteByScenicSpotId(scenicSpotId);
|
||||
}
|
||||
if (tagCodeList != null && tagCodeList.size() > 0) {
|
||||
List<ScenicSpotTagEntity> scenicSpotTagList = new ArrayList<>();
|
||||
ScenicSpotTagEntity scenicSpotTagEntity;
|
||||
for (String item : tagCodeList) {
|
||||
scenicSpotTagEntity = new ScenicSpotTagEntity();
|
||||
scenicSpotTagEntity.setTagCode(item);
|
||||
scenicSpotTagEntity.setScenicSpotId(scenicSpotId);
|
||||
scenicSpotTagList.add(scenicSpotTagEntity);
|
||||
}
|
||||
result = scenicSpotTagService.saveBatch(scenicSpotTagList);
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新精选图片
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @param featuredPhotoFileList 精选图片集合
|
||||
* @param isUpdate 是否是更新
|
||||
* @return
|
||||
*/
|
||||
private boolean updateFeaturedPhoto(Long scenicSpotId, List<FileInfoDto> featuredPhotoFileList, boolean isUpdate) {
|
||||
boolean result = false;
|
||||
if (scenicSpotId != null) {
|
||||
if (isUpdate) {
|
||||
//先删除
|
||||
featuredPhotoService.deleteByScenicSpotId(scenicSpotId);
|
||||
}
|
||||
if (featuredPhotoFileList != null && featuredPhotoFileList.size() > 0) {
|
||||
List<FeaturedPhotoEntity> featuredPhotoList = new ArrayList<>();
|
||||
FeaturedPhotoEntity featuredPhotoEntity;
|
||||
int orderNumber = 1;
|
||||
for (FileInfoDto item : featuredPhotoFileList) {
|
||||
if(item != null && StrUtil.isNotEmpty(item.getUrl())){
|
||||
featuredPhotoEntity = new FeaturedPhotoEntity();
|
||||
featuredPhotoEntity.setPhotoFile(JSONObject.toJSONString(item));
|
||||
featuredPhotoEntity.setScenicSpotId(scenicSpotId);
|
||||
featuredPhotoEntity.setOrderNumber(orderNumber);
|
||||
featuredPhotoList.add(featuredPhotoEntity);
|
||||
orderNumber++;
|
||||
}
|
||||
}
|
||||
if(featuredPhotoList != null && featuredPhotoList.size() > 0){
|
||||
result = featuredPhotoService.saveBatch(featuredPhotoList);
|
||||
}
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新景点和设备关联关系
|
||||
*
|
||||
* @param scenicSpotId 景点ID
|
||||
* @param deviceSn 设备SN
|
||||
* @param isUpdate 是否是更新
|
||||
* @return
|
||||
*/
|
||||
private boolean updateDevice(Long scenicSpotId, String deviceSn, boolean isUpdate) {
|
||||
boolean result = false;
|
||||
if (scenicSpotId != null) {
|
||||
if (isUpdate) {
|
||||
//先删除
|
||||
scenicSpotDeviceService.deleteByScenicSpotId(scenicSpotId);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(deviceSn)) {
|
||||
ScenicSpotDeviceEntity scenicSpotDeviceEntity = new ScenicSpotDeviceEntity();
|
||||
scenicSpotDeviceEntity.setScenicSpotId(scenicSpotId);
|
||||
scenicSpotDeviceEntity.setDeviceSn(deviceSn);
|
||||
result = scenicSpotDeviceService.save(scenicSpotDeviceEntity);
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备SN获取景点信息
|
||||
*
|
||||
* @param deviceSn 设备SN
|
||||
* @return
|
||||
*/
|
||||
public ScenicSpotVO getByDeviceSn(String deviceSn) {
|
||||
ScenicSpotVO model = new ScenicSpotVO();
|
||||
if (StrUtil.isNotEmpty(deviceSn)) {
|
||||
List<ScenicSpotDeviceEntity> scenicSpotDeviceList = scenicSpotDeviceService.getListByDeviceSn(deviceSn);
|
||||
if (scenicSpotDeviceList != null && scenicSpotDeviceList.size() > 0) {
|
||||
Long scenicSpotId = scenicSpotDeviceList.get(0).getScenicSpotId();
|
||||
ScenicSpotEntity entity = scenicSpotService.getById(scenicSpotId);
|
||||
model = doToVo(entity);
|
||||
model.setDeviceSn(deviceSn);
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实体转换
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return
|
||||
*/
|
||||
private ScenicSpotVO doToVo(ScenicSpotEntity entity) {
|
||||
ScenicSpotVO model = new ScenicSpotVO();
|
||||
if (entity != null && entity.getId() != null) {
|
||||
BeanUtil.copyProperties(entity, model,"photoFile", "introduceAudioFile", "virtualFlyPhotoFile");
|
||||
if(StrUtil.isNotEmpty(entity.getPhotoFile())){
|
||||
JSONObject json = JSONObject.parseObject(entity.getPhotoFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
model.setPhotoFile(fileInfoDto);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(entity.getIntroduceAudioFile())){
|
||||
JSONObject json = JSONObject.parseObject(entity.getIntroduceAudioFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
model.setIntroduceAudioFile(fileInfoDto);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(entity.getVirtualFlyPhotoFile())){
|
||||
JSONObject json = JSONObject.parseObject(entity.getVirtualFlyPhotoFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
model.setVirtualFlyPhotoFile(fileInfoDto);
|
||||
}
|
||||
List<String> tagCodeList = new ArrayList<>();
|
||||
List<String> tagNameList = new ArrayList<>();
|
||||
List<ScenicSpotTagEntity> scenicSpotTagList = scenicSpotTagService.getListByScenicSpotId(entity.getId());
|
||||
if (scenicSpotTagList != null && scenicSpotTagList.size() > 0) {
|
||||
tagCodeList = scenicSpotTagList.stream().map(ScenicSpotTagEntity::getTagCode).collect(Collectors.toList());
|
||||
List<TourismTagEntity> tagList = tagService.getListByCodeList(tagCodeList);
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
tagNameList = tagList.stream().map(TourismTagEntity::getTagName).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
model.setTagCodeList(tagCodeList);
|
||||
model.setTagNameList(tagNameList);
|
||||
List<FileInfoDto> featuredPhotoUrlList = new ArrayList<>();
|
||||
List<FeaturedPhotoEntity> featuredPhotoList = featuredPhotoService.getListByScenicSpotId(entity.getId());
|
||||
if (featuredPhotoList != null && featuredPhotoList.size() > 0) {
|
||||
for (FeaturedPhotoEntity item : featuredPhotoList) {
|
||||
if(StrUtil.isNotEmpty(item.getPhotoFile())){
|
||||
JSONObject json = JSONObject.parseObject(item.getPhotoFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
featuredPhotoUrlList.add(fileInfoDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
model.setFeaturedPhotoFileList(featuredPhotoUrlList);
|
||||
List<FeaturedRouteVO> featuredRouteVOList = new ArrayList<>();
|
||||
List<FeaturedRouteEntity> routeList = featuredRouteService.getListByScenicSpotId(entity.getId());
|
||||
if (routeList != null && routeList.size() > 0) {
|
||||
FeaturedRouteVO featuredRouteVO;
|
||||
for (FeaturedRouteEntity item : routeList) {
|
||||
featuredRouteVO = new FeaturedRouteVO();
|
||||
BeanUtil.copyProperties(item, featuredRouteVO, "routeFile");
|
||||
if(StrUtil.isEmpty(item.getRouteName())){
|
||||
RouteDTO routeDTO = routeManager.getById(item.getRouteId());
|
||||
if (routeDTO != null && StrUtil.isNotEmpty(routeDTO.getRouteName())) {
|
||||
if (StrUtil.isNotEmpty(routeDTO.getRouteName())) {
|
||||
String routeName = RSAUtil.decryptOne(routeDTO.getRouteName());
|
||||
featuredRouteVO.setRouteName(routeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(item.getRouteFile())){
|
||||
JSONObject json = JSONObject.parseObject(item.getRouteFile());
|
||||
FileInfoDto fileInfoDto = json.toJavaObject(FileInfoDto.class);
|
||||
featuredRouteVO.setRouteFile(fileInfoDto);
|
||||
}
|
||||
featuredRouteVOList.add(featuredRouteVO);
|
||||
}
|
||||
}
|
||||
model.setRouteList(featuredRouteVOList);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<ScenicSpotPageVO> selectPageList(ScenicSpotPageQuery query) {
|
||||
Map<String, Object> map = new HashMap<>(3);
|
||||
if (StrUtil.isNotEmpty(query.getScenicSpotGrade())) {
|
||||
map.put("scenicSpotGrade", query.getScenicSpotGrade());
|
||||
}
|
||||
if (StrUtil.isNotEmpty(query.getScenicSpotName())) {
|
||||
map.put("scenicSpotName", query.getScenicSpotName());
|
||||
}
|
||||
if (StrUtil.isNotEmpty(query.getTagCode())) {
|
||||
map.put("tagCode", query.getTagCode());
|
||||
}
|
||||
PageInfo<ScenicSpotEntity> scenicSpotPageList = scenicSpotService.getScenicSpotPageList(query.getPager(), map);
|
||||
PageInfo<ScenicSpotPageVO> pageList = new PageInfo<>();
|
||||
BeanUtil.copyProperties(scenicSpotPageList, pageList);
|
||||
if (scenicSpotPageList.getList() != null && scenicSpotPageList.getList().size() > 0) {
|
||||
List<ScenicSpotEntity> list = scenicSpotPageList.getList();
|
||||
List<ScenicSpotPageVO> voList = new ArrayList<>(list.size());
|
||||
List<Long> idList = list.stream().map(ScenicSpotEntity::getId).collect(Collectors.toList());
|
||||
List<BiaxVideoEntity> biaxVideoList = biaxVideoService.getListByScenicSpotIdList(idList);
|
||||
List<PanoramaPhotoEntity> panoramaPhotoList = panoramaPhotoService.getListByScenicSpotIdList(idList);
|
||||
for (ScenicSpotEntity item : list) {
|
||||
ScenicSpotPageVO model = doToPageVO(item, biaxVideoList, panoramaPhotoList);
|
||||
voList.add(model);
|
||||
}
|
||||
pageList.setList(voList);
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实体转换
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return
|
||||
*/
|
||||
private ScenicSpotPageVO doToPageVO(ScenicSpotEntity entity, List<BiaxVideoEntity> biaxVideoList, List<PanoramaPhotoEntity> panoramaPhotoList) {
|
||||
ScenicSpotPageVO model = new ScenicSpotPageVO();
|
||||
BeanUtil.copyProperties(entity, model);
|
||||
List<ScenicSpotDeviceEntity> scenicSpotDeviceList = scenicSpotDeviceService.getListByScenicSpotId(entity.getId());
|
||||
if (scenicSpotDeviceList != null && scenicSpotDeviceList.size() > 0) {
|
||||
model.setDeviceSn(scenicSpotDeviceList.get(0).getDeviceSn());
|
||||
if (StrUtil.isNotEmpty(model.getDeviceSn())) {
|
||||
IkDeviceEntity deviceEntity = ikDeviceService.getByDeviceSn(model.getDeviceSn());
|
||||
if (deviceEntity != null && StrUtil.isNotEmpty(deviceEntity.getDeviceName())) {
|
||||
model.setDeviceName(deviceEntity.getDeviceName());
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> tagNameList = new ArrayList<>();
|
||||
List<ScenicSpotTagEntity> scenicSpotTagList = scenicSpotTagService.getListByScenicSpotId(entity.getId());
|
||||
if (scenicSpotTagList != null && scenicSpotTagList.size() > 0) {
|
||||
List<String> tagCodeList = scenicSpotTagList.stream().map(ScenicSpotTagEntity::getTagCode).collect(Collectors.toList());
|
||||
List<TourismTagEntity> tagList = tagService.getListByCodeList(tagCodeList);
|
||||
if (tagList != null && tagList.size() > 0) {
|
||||
tagNameList = tagList.stream().map(TourismTagEntity::getTagName).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
model.setTagNameList(tagNameList);
|
||||
if (biaxVideoList != null && biaxVideoList.size() > 0) {
|
||||
List<BiaxVideoEntity> tempList = biaxVideoList.stream().filter(o -> o.getScenicSpotId() != null && o.getScenicSpotId().equals(entity.getId())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
model.setBiaxVideoName(tempList.get(0).getBiaxVideoName());
|
||||
}
|
||||
}
|
||||
if (panoramaPhotoList != null && panoramaPhotoList.size() > 0) {
|
||||
List<PanoramaPhotoEntity> tempList = panoramaPhotoList.stream().filter(o -> o.getScenicSpotId() != null && o.getScenicSpotId().equals(entity.getId())).collect(Collectors.toList());
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
model.setPanoramaPhotoName(tempList.get(0).getPhotoName());
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Result delete(Long id) {
|
||||
if (id != null) {
|
||||
//删除景点
|
||||
boolean result = scenicSpotService.removeById(id);
|
||||
if (result) {
|
||||
//删除景点精选航线
|
||||
featuredRouteService.deleteByScenicSpotId(id);
|
||||
//删除热门景点
|
||||
popularScenicSpotService.deleteByScenicSpotId(id);
|
||||
//删除精选照片
|
||||
featuredPhotoService.deleteByScenicSpotId(id);
|
||||
//删除双轴视频
|
||||
biaxVideoService.deleteByScenicSpotId(id);
|
||||
//删除全景照片
|
||||
panoramaPhotoService.deleteByScenicSpotId(id);
|
||||
//删除景点与设备关系
|
||||
scenicSpotDeviceService.deleteByScenicSpotId(id);
|
||||
//删除我的收藏
|
||||
myFavoriteService.deleteByScenicSpotId(id);
|
||||
return Result.succeed("操作成功!");
|
||||
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
} else {
|
||||
return Result.failed("主键ID为空,操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param model 新增实体
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result add(ScenicSpotAddDTO model, Long userId) {
|
||||
if(model.getTagCodeList() != null){
|
||||
if(model.getTagCodeList().size() > 4){
|
||||
return Result.failed("景点标签最多只能添加4个,操作失败!");
|
||||
}
|
||||
}
|
||||
ScenicSpotEntity entity = new ScenicSpotEntity();
|
||||
BeanUtil.copyProperties(model, entity, "photoFile", "introduceAudioFile", "virtualFlyPhotoFile");
|
||||
boolean existName = scenicSpotService.existName(entity);
|
||||
if (existName) {
|
||||
return Result.failed("景点名称已存在,操作失败!");
|
||||
}
|
||||
if(model.getRouteList() != null && model.getRouteList().size() > 0){
|
||||
for (FeaturedRouteAddDTO item : model.getRouteList()) {
|
||||
if(StrUtil.isEmpty(item.getRouteName())){
|
||||
return Result.failed("精选航线ID不能为空,操作失败!");
|
||||
}
|
||||
if(StrUtil.isEmpty(item.getRouteName())){
|
||||
return Result.failed("精选航线名称不能为空,操作失败!");
|
||||
}else if(item.getRouteName().length() > 15){
|
||||
return Result.failed("精选航线名称超度不能超过15个字符,操作失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
entity.setUpdateUserId(userId);
|
||||
entity.setCreateUserId(userId);
|
||||
if (StrUtil.isNotEmpty(model.getDeviceSn())) {
|
||||
IkDeviceEntity deviceDetailDTO = ikDeviceService.getByDeviceSn(model.getDeviceSn());
|
||||
if (deviceDetailDTO != null && deviceDetailDTO.getId() != null) {
|
||||
entity.setLongitude(deviceDetailDTO.getLongitude());
|
||||
entity.setLatitude(deviceDetailDTO.getLatitude());
|
||||
entity.setAltitude(deviceDetailDTO.getAltitude());
|
||||
}
|
||||
}
|
||||
if(model.getPhotoFile() != null && StrUtil.isNotEmpty(model.getPhotoFile().getUrl())){
|
||||
String photoFile = JSONObject.toJSONString(model.getPhotoFile());
|
||||
entity.setPhotoFile(photoFile);
|
||||
}
|
||||
if(model.getIntroduceAudioFile() != null && StrUtil.isNotEmpty(model.getIntroduceAudioFile().getUrl())){
|
||||
String introduceAudioFile = JSONObject.toJSONString(model.getIntroduceAudioFile());
|
||||
entity.setIntroduceAudioFile(introduceAudioFile);
|
||||
}
|
||||
if(model.getVirtualFlyPhotoFile() != null && StrUtil.isNotEmpty(model.getVirtualFlyPhotoFile().getUrl())){
|
||||
String virtualFlyPhotoFile = JSONObject.toJSONString(model.getVirtualFlyPhotoFile());
|
||||
entity.setVirtualFlyPhotoFile(virtualFlyPhotoFile);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getProvinceCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getProvinceCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setProvince(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getCityCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getCityCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setCity(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getScenicAreaCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getScenicAreaCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setScenicArea(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getOrgCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getOrgCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setOrgName(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
entity.setScenicSpotAddress(entity.getProvince() + entity.getCity() + entity.getScenicArea());
|
||||
boolean result = scenicSpotService.save(entity);
|
||||
if (result) {
|
||||
//新增或更新景点标签
|
||||
updateTag(entity.getId(), model.getTagCodeList(), false);
|
||||
//更新精选图片
|
||||
updateFeaturedPhoto(entity.getId(), model.getFeaturedPhotoFileList(), false);
|
||||
//更新绑定设备
|
||||
updateDevice(entity.getId(), model.getDeviceSn(), false);
|
||||
//更新航线
|
||||
updateRoute(entity.getId(), model.getRouteList(), false);
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param model 编辑实体
|
||||
* @param userId 操作用户ID
|
||||
* @return
|
||||
*/
|
||||
public Result update(ScenicSpotUpdateDTO model, Long userId) {
|
||||
if(model.getTagCodeList() != null){
|
||||
if(model.getTagCodeList().size() > 4){
|
||||
return Result.failed("景点标签最多只能添加4个,操作失败!");
|
||||
}
|
||||
}
|
||||
ScenicSpotEntity entity = new ScenicSpotEntity();
|
||||
BeanUtil.copyProperties(model, entity, "photoFile", "introduceAudioFile", "virtualFlyPhotoFile");
|
||||
boolean existName = scenicSpotService.existName(entity);
|
||||
if (existName) {
|
||||
return Result.failed("景点名称已存在,操作失败!");
|
||||
}
|
||||
if(model.getRouteList() != null && model.getRouteList().size() > 0){
|
||||
for (FeaturedRouteAddDTO item : model.getRouteList()) {
|
||||
if(StrUtil.isEmpty(item.getRouteName())){
|
||||
return Result.failed("精选航线ID不能为空,操作失败!");
|
||||
}
|
||||
if(StrUtil.isEmpty(item.getRouteName())){
|
||||
return Result.failed("精选航线名称不能为空,操作失败!");
|
||||
}else if(item.getRouteName().length() > 15){
|
||||
return Result.failed("精选航线名称超度不能超过15个字符,操作失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
entity.setUpdateUserId(userId);
|
||||
if (StrUtil.isNotEmpty(model.getDeviceSn())) {
|
||||
IkDeviceEntity deviceDetailDTO = ikDeviceService.getByDeviceSn(model.getDeviceSn());
|
||||
if (deviceDetailDTO != null && deviceDetailDTO.getId() != null) {
|
||||
entity.setLongitude(deviceDetailDTO.getLongitude());
|
||||
entity.setLatitude(deviceDetailDTO.getLatitude());
|
||||
entity.setAltitude(deviceDetailDTO.getAltitude());
|
||||
}
|
||||
}
|
||||
if(model.getPhotoFile() != null && StrUtil.isNotEmpty(model.getPhotoFile().getUrl())){
|
||||
String photoFile = JSONObject.toJSONString(model.getPhotoFile());
|
||||
entity.setPhotoFile(photoFile);
|
||||
}
|
||||
if(model.getIntroduceAudioFile() != null && StrUtil.isNotEmpty(model.getIntroduceAudioFile().getUrl())){
|
||||
String introduceAudioFile = JSONObject.toJSONString(model.getIntroduceAudioFile());
|
||||
entity.setIntroduceAudioFile(introduceAudioFile);
|
||||
}
|
||||
if(model.getVirtualFlyPhotoFile() != null && StrUtil.isNotEmpty(model.getVirtualFlyPhotoFile().getUrl())){
|
||||
String virtualFlyPhotoFile = JSONObject.toJSONString(model.getVirtualFlyPhotoFile());
|
||||
entity.setVirtualFlyPhotoFile(virtualFlyPhotoFile);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getProvinceCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getProvinceCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setProvince(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getCityCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getCityCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setCity(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getScenicAreaCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getScenicAreaCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setScenicArea(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(model.getOrgCode())){
|
||||
OrganizationDTO organizationDTO = organizationManager.getOrgById(Long.parseLong(model.getOrgCode()));
|
||||
if(organizationDTO != null && StrUtil.isNotEmpty(organizationDTO.getName())){
|
||||
entity.setOrgName(organizationDTO.getName());
|
||||
}
|
||||
}
|
||||
entity.setScenicSpotAddress(entity.getProvince() + entity.getCity() + entity.getScenicArea());
|
||||
boolean result = scenicSpotService.updateById(entity);
|
||||
if (result) {
|
||||
//新增或更新景点标签
|
||||
updateTag(entity.getId(), model.getTagCodeList(), true);
|
||||
//更新精选图片
|
||||
updateFeaturedPhoto(entity.getId(), model.getFeaturedPhotoFileList(), true);
|
||||
//更新绑定设备
|
||||
updateDevice(entity.getId(), model.getDeviceSn(), true);
|
||||
//更新航线
|
||||
updateRoute(entity.getId(), model.getRouteList(), true);
|
||||
return Result.succeed("操作成功!");
|
||||
} else {
|
||||
return Result.failed("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID获取实体
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
public ScenicSpotVO getEntity(Long id) {
|
||||
ScenicSpotVO model = new ScenicSpotVO();
|
||||
if (id != null) {
|
||||
ScenicSpotEntity entity = scenicSpotService.getById(id);
|
||||
if (entity != null && entity.getId() != null) {
|
||||
model = doToVo(entity);
|
||||
List<ScenicSpotDeviceEntity> list = scenicSpotDeviceService.getListByScenicSpotId(id);
|
||||
if (list != null && list.size() > 0) {
|
||||
model.setDeviceSn(list.get(0).getDeviceSn());
|
||||
}
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 双轴视频上轴标记视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频上轴标记视图实体类
|
||||
* @create 2024/7/18 8:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频上轴标记视图实体类")
|
||||
public class BiaxVideoDownTagVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标记位置(mm:ss)
|
||||
*/
|
||||
@Schema(description ="标记位置(mm:ss)")
|
||||
private String tagPosition;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频分页视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频分页视图实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频分页视图实体类")
|
||||
public class BiaxVideoPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description ="航线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 上轴标记点名称列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点名称列表")
|
||||
private List<String> upTagNameList;
|
||||
|
||||
/**
|
||||
* 下轴轴标记点名称列表
|
||||
*/
|
||||
@Schema(description ="下轴轴标记点名称列表")
|
||||
private List<String> downTagNameList;
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 双轴视频上轴标记视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频上轴标记视图实体类
|
||||
* @create 2024/7/18 8:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频上轴标记视图实体类")
|
||||
public class BiaxVideoUpTagVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双轴视频视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 双轴视频视图实体类
|
||||
* @create 2024/7/18 8:26
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="双轴视频视图实体类")
|
||||
public class BiaxVideoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 设备SN
|
||||
*/
|
||||
@Schema(description ="设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description ="航线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@Schema(description ="视频文件")
|
||||
private FileInfoDto videoFile;
|
||||
|
||||
/**
|
||||
* 视频时长(秒)
|
||||
*/
|
||||
@Schema(description ="视频时长(秒)")
|
||||
private Integer videoMins;
|
||||
|
||||
/**
|
||||
* 上轴标记点每段时长(秒)
|
||||
*/
|
||||
@Schema(description ="上轴标记点每段时长(秒)")
|
||||
private Integer upTagPosition;
|
||||
|
||||
/**
|
||||
* 上轴标记点名称列表
|
||||
*/
|
||||
@Schema(description ="上轴标记点名称列表")
|
||||
private List<BiaxVideoUpTagVO> upTagList;
|
||||
|
||||
/**
|
||||
* 下轴轴标记点列表
|
||||
*/
|
||||
@Schema(description ="下轴轴标记点列表")
|
||||
private List<BiaxVideoDownTagVO> downTagList;
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 设备实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 设备实体类
|
||||
* @create 2024/7/19 11:15
|
||||
**/
|
||||
@Schema(description ="设备实体类")
|
||||
@Data
|
||||
public class DeviceBasicVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备id 与发货铭牌一致
|
||||
*/
|
||||
@Schema(description = "设备id 与发货铭牌一致")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型 对于机库 1001:固定机库,1002:车载机库, 2001:旋翼飞机,2002:固定翼
|
||||
*/
|
||||
@Schema(description = "设备类型: 对于机库 1001:固定机库,1002:车载机库,1003:圣机库, 2001:旋翼飞机,2002:固定翼, 2003:圣飞机,3001:ly-c100,3002:ly-d100, 4001:监控摄像头")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 设备位置 经度
|
||||
*/
|
||||
@Schema(description = "设备位置 经度,如果是圣机库,那么是机库中心经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 设备位置 纬度
|
||||
*/
|
||||
@Schema(description = "设备位置 纬度,如果是圣机库,那么是机库中心纬度")
|
||||
private BigDecimal latitude;
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 设备实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 设备实体类
|
||||
* @create 2024/7/19 11:15
|
||||
**/
|
||||
@Schema(description ="设备实体类")
|
||||
@Data
|
||||
public class DeviceVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备id 与发货铭牌一致
|
||||
*/
|
||||
@Schema(description = "设备id 与发货铭牌一致")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 控制指令版本,0:v1.0(老) 1:v2.0(新)
|
||||
*/
|
||||
@Schema(description = "控制指令版本,0:v1.0(老ws) 1:v2.0(新mqtt")
|
||||
private Integer cmdVersion;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型 对于机库 1001:固定机库,1002:车载机库, 2001:旋翼飞机,2002:固定翼
|
||||
*/
|
||||
@Schema(description = "设备类型: 对于机库 1001:固定机库,1002:车载机库,1003:圣机库, 2001:旋翼飞机,2002:固定翼, 2003:圣飞机,3001:ly-c100,3002:ly-d100, 4001:监控摄像头")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 设备位置 经度
|
||||
*/
|
||||
@Schema(description = "设备位置 经度,如果是圣机库,那么是机库中心经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 设备位置 纬度
|
||||
*/
|
||||
@Schema(description = "设备位置 纬度,如果是圣机库,那么是机库中心纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 设备位置 海拔
|
||||
*/
|
||||
@Schema(description = "设备位置 海拔,如果是圣机库,那么是机库中心海拔")
|
||||
private BigDecimal altitude;
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 特色景观标签视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 特色景观标签视图实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="特色景观标签视图实体类")
|
||||
@Data
|
||||
public class FeatureTagVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 精选航线实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 精选航线实体类
|
||||
* @create 2024/7/18 15:40
|
||||
**/
|
||||
@Schema(description ="精选航线实体类")
|
||||
@Data
|
||||
public class FeaturedRouteVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description ="航线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 航线视频文件
|
||||
*/
|
||||
@Schema(description ="航线视频文件")
|
||||
private FileInfoDto routeFile;
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 设备视图实体类
|
||||
* @create 2024/7/25 16:18
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="设备视图实体类")
|
||||
public class IkDeviceVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备SN与发货铭牌一致
|
||||
*/
|
||||
@Schema(description = "设备SN 与发货铭牌一致")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型 对于机库 1001:固定机库,1002:车载机库, 2001:旋翼飞机,2002:固定翼
|
||||
*/
|
||||
@Schema(description = "设备类型: 对于机库 1001:固定机库,1002:车载机库,1003:圣机库, 2001:旋翼飞机,2002:固定翼, 2003:圣飞机,3001:ly-c100,3002:ly-d100, 4001:监控摄像头")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 设备位置 经度
|
||||
*/
|
||||
@Schema(description = "设备位置 经度,如果是圣机库,那么是机库中心经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 设备位置 纬度
|
||||
*/
|
||||
@Schema(description = "设备位置 纬度,如果是圣机库,那么是机库中心纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 设备位置 海拔
|
||||
*/
|
||||
@Schema(description = "设备位置 海拔,如果是圣机库,那么是机库中心海拔")
|
||||
private BigDecimal altitude;
|
||||
|
||||
/**
|
||||
* 用于标识飞机与机库的配对关系
|
||||
*/
|
||||
@Schema(description = "用于标识飞机与机库的配对关系,如果是圣机库,那么是左仓和飞机的配对关系")
|
||||
private String pairedDevice;
|
||||
|
||||
/**
|
||||
* 圣机库左仓与飞机的配对关系
|
||||
*/
|
||||
@Schema(description = "圣机库左仓与飞机的配对关系")
|
||||
private String pairedDevice1;
|
||||
|
||||
/**
|
||||
* 圣机库右仓与飞机的配对关系
|
||||
*/
|
||||
@Schema(description = "圣机库右仓与飞机的配对关系")
|
||||
private String pairedDevice2;
|
||||
|
||||
/**
|
||||
* 设备可用状态 0:维修 1:待命 2:停用 3:任务中
|
||||
*/
|
||||
@Schema(description = "设备可用状态 0:维修 1:待命 2:停用 3:任务中")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 设备相关信息描述
|
||||
*/
|
||||
@Schema(description = "设备相关信息描述")
|
||||
private String descMsg;
|
||||
|
||||
/**
|
||||
* 是否删除 0 正常 1 删除
|
||||
*/
|
||||
@Schema(description = "是否删除记录")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 行业类型 1 电网,2 水利,3 石油(中石化),4 安防(三一),5 智慧城市(生态城)
|
||||
*/
|
||||
@Schema(description = "这是用的ik_industry这张表,行业类型 1 电网,2 水利,3 石油(中石化),4 安防(三一),5 智慧城市(生态城)")
|
||||
private Long industryId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 机构基础视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 机构基础视图实体类
|
||||
* @create 2024/8/7 15:05
|
||||
**/
|
||||
@Schema(description ="机构基础视图实体类")
|
||||
@Data
|
||||
public class OrganizationBasicVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@Schema(description ="机构名称")
|
||||
private String name;
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全景照片分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片分页实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片分页实体类")
|
||||
public class PanoramaPhotoPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 标记点名称列表
|
||||
*/
|
||||
@Schema(description ="标记点名称列表")
|
||||
private List<String> tagNameList;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description ="经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description ="纬度")
|
||||
private BigDecimal latitude;
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全景照片标签实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片标签实体类
|
||||
* @create 2024/7/18 8:31
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片标记实体类")
|
||||
public class PanoramaPhotoTagVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标记名称
|
||||
*/
|
||||
@Schema(description ="标记名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 照片文件
|
||||
*/
|
||||
@Schema(description ="照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全景照片视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 全景照片视图实体类
|
||||
* @create 2024/7/18 8:20
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="全景照片视图实体类")
|
||||
public class PanoramaPhotoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 照片名称
|
||||
*/
|
||||
@Schema(description ="照片名称")
|
||||
private String photoName;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
private String scenicSpotId;
|
||||
|
||||
/**
|
||||
* 标记点列表
|
||||
*/
|
||||
@Schema(description ="标记点列表")
|
||||
private List<PanoramaPhotoTagVO> tagList;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description ="经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description ="纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 特色景观标签编码列表
|
||||
*/
|
||||
@Schema(description ="特色景观标签编码列表")
|
||||
private List<String> featureTagCodeList;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 热门景点列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点列表实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门景点列表实体类")
|
||||
public class PopularScenicSpotListBasicVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long scenicSpotId;
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 热门景点列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点列表实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门景点列表实体类")
|
||||
public class PopularScenicSpotListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 热门景点分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门景点分页实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门景点分页实体类")
|
||||
public class PopularScenicSpotPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点ID
|
||||
*/
|
||||
@Schema(description ="景点ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long scenicSpotId;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 热门标签列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签列表实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门标签列表实体类")
|
||||
public class PopularTagListBasicVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 热门标签列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签列表实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门标签列表实体类")
|
||||
public class PopularTagListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 热门标签分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 热门标签分页实体类
|
||||
* @create 2024/7/18 8:46
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="热门标签分页实体类")
|
||||
public class PopularTagPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员编码
|
||||
*/
|
||||
@Schema(description ="更新人员编码")
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 航线实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 航线实体类
|
||||
* @create 2024/8/7 10:03
|
||||
**/
|
||||
@Schema(description ="航线实体类")
|
||||
@Data
|
||||
public class RouteTreeVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long routeId;
|
||||
@Schema(description = "航线名称,明文")
|
||||
private String routeName;
|
||||
|
||||
@Schema(description = "航线名称,密文")
|
||||
private String routeNameDecode;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String code;
|
||||
|
||||
@Schema(description = "航线被执行次数")
|
||||
private Integer routeRunNum;
|
||||
|
||||
@Schema(description = "航线长度,单位米")
|
||||
private Double routeLength;
|
||||
|
||||
@Schema(description = "预计飞行时长,单位秒")
|
||||
private Double preFlyTime;
|
||||
|
||||
@Schema(description = "是否不显示,0:显示、1:不显示")
|
||||
private Integer isNotShow;
|
||||
|
||||
@Schema(description = "航线归属人id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "航线parentId")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "航线Id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "子航线")
|
||||
private List<RouteTreeVO> children;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 航线实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 航线实体类
|
||||
* @create 2024/8/7 10:03
|
||||
**/
|
||||
@Schema(description ="航线实体类")
|
||||
@Data
|
||||
public class RouteVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 航线ID
|
||||
*/
|
||||
@Schema(description ="航线ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 航线名称
|
||||
*/
|
||||
@Schema(description = "航线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 航线parentId
|
||||
*/
|
||||
@Schema(description = "航线parentId")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 航线Id
|
||||
*/
|
||||
@Schema(description = "航线Id")
|
||||
private Long id;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 景点视图列表基础实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点视图列表基础实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点视图列表基础实体类")
|
||||
@Data
|
||||
public class ScenicSpotBaseListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
private String scenicSpotGrade;
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 景点视分页图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点视分页图实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点视分页图实体类")
|
||||
@Data
|
||||
public class ScenicSpotPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 地址-景区
|
||||
*/
|
||||
@Schema(description ="地址-景区")
|
||||
private String scenicArea;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description ="地址")
|
||||
private String scenicSpotAddress;
|
||||
|
||||
/**
|
||||
* 标签名称集合
|
||||
*/
|
||||
@Schema(description ="标签名称集合")
|
||||
private List<String> tagNameList;
|
||||
|
||||
/**
|
||||
* 关联设备SN
|
||||
*/
|
||||
@Schema(description ="关联设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
/**
|
||||
* 关联设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 双轴视频名称
|
||||
*/
|
||||
@Schema(description ="双轴视频名称")
|
||||
private String biaxVideoName;
|
||||
|
||||
/**
|
||||
* 全景照片名称
|
||||
*/
|
||||
@Schema(description ="全景照片名称")
|
||||
private String panoramaPhotoName;
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.central.common.params.dto.FileInfoDto;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 景点视图实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 景点视图实体类
|
||||
* @create 2024/7/17 14:10
|
||||
**/
|
||||
@Schema(description ="景点视图实体类")
|
||||
@Data
|
||||
public class ScenicSpotVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景点名称
|
||||
*/
|
||||
@Schema(description ="景点名称")
|
||||
private String scenicSpotName;
|
||||
|
||||
/**
|
||||
* 景点等级
|
||||
*/
|
||||
@Schema(description ="景点等级")
|
||||
private String scenicSpotGrade;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@Schema(description ="机构名称")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
@Schema(description ="机构编码")
|
||||
private Integer orgCode;
|
||||
|
||||
/**
|
||||
* 地址-省份
|
||||
*/
|
||||
@Schema(description ="地址-省份")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 地址-省份编码
|
||||
*/
|
||||
@Schema(description ="地址-省份编码")
|
||||
private Integer provinceCode;
|
||||
|
||||
/**
|
||||
* 地址-地市
|
||||
*/
|
||||
@Schema(description ="地址-地市")
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 地址-地市编码
|
||||
*/
|
||||
@Schema(description ="地址-地市编码")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 地址-景区
|
||||
*/
|
||||
@Schema(description ="地址-景区")
|
||||
private String scenicArea;
|
||||
|
||||
/**
|
||||
* 地址-景区编码
|
||||
*/
|
||||
@Schema(description ="地址-景区编码")
|
||||
private String scenicAreaCode;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Schema(description ="地址")
|
||||
private String scenicSpotAddress;
|
||||
|
||||
/**
|
||||
* 热度
|
||||
*/
|
||||
@Schema(description ="热度")
|
||||
private BigDecimal hotScore;
|
||||
|
||||
/**
|
||||
* 景点照片文件
|
||||
*/
|
||||
@Schema(description ="景点照片文件")
|
||||
private FileInfoDto photoFile;
|
||||
|
||||
/**
|
||||
* 语音讲解文件
|
||||
*/
|
||||
@Schema(description ="语音讲解文件")
|
||||
private FileInfoDto introduceAudioFile;
|
||||
|
||||
/**
|
||||
* 虚拟飞行图片文件
|
||||
*/
|
||||
@Schema(description ="虚拟飞行图片文件")
|
||||
private FileInfoDto virtualFlyPhotoFile;
|
||||
|
||||
/**
|
||||
* 精选图片文件集合
|
||||
*/
|
||||
@Schema(description ="精选图片文件集合")
|
||||
private List<FileInfoDto> featuredPhotoFileList;
|
||||
|
||||
/**
|
||||
* 标签编码集合
|
||||
*/
|
||||
@Schema(description ="标签编码集合")
|
||||
private List<String> tagCodeList;
|
||||
|
||||
/**
|
||||
* 标签名称集合
|
||||
*/
|
||||
@Schema(description ="标签名称集合")
|
||||
private List<String> tagNameList;
|
||||
|
||||
/**
|
||||
* 精选航线
|
||||
*/
|
||||
@Schema(description ="精选航线")
|
||||
private List<FeaturedRouteVO> routeList;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description ="简介")
|
||||
private String scenicSpotAbout;
|
||||
|
||||
/**
|
||||
* 关联设备SN
|
||||
*/
|
||||
@Schema(description ="关联设备SN")
|
||||
private String deviceSn;
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 主播列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 主播列表实体类
|
||||
* @create 2024/7/16 11:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="主播列表实体类")
|
||||
public class TourismStreamerListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description ="用户ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description ="用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Schema(description ="真实姓名")
|
||||
private String realName;
|
||||
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description ="手机号")
|
||||
private String mobile;
|
||||
|
||||
|
||||
/**
|
||||
* 主播类型(1:主播,2:副播)
|
||||
*/
|
||||
@Schema(description ="主播类型(1:主播,2:副播)")
|
||||
private Integer streamerType;
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员ID
|
||||
*/
|
||||
@Schema(description ="更新人员ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 主播分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 主播分页实体类
|
||||
* @create 2024/7/16 11:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="主播分页实体类")
|
||||
public class TourismStreamerPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description ="用户ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description ="用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Schema(description ="真实姓名")
|
||||
private String realName;
|
||||
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description ="手机号")
|
||||
private String mobile;
|
||||
|
||||
|
||||
/**
|
||||
* 主播类型(1:主播,2:副播)
|
||||
*/
|
||||
@Schema(description ="主播类型(1:主播,2:副播)")
|
||||
private Integer streamerType;
|
||||
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Schema(description ="创建人员ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description ="创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新人员ID
|
||||
*/
|
||||
@Schema(description ="更新人员ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description ="更新时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 标签列表实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签列表实体类
|
||||
* @create 2024/7/16 11:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="标签列表实体类")
|
||||
public class TourismTagListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 标签分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 标签分页实体类
|
||||
* @create 2024/7/16 11:52
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="标签分页实体类")
|
||||
public class TourismTagPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签编码
|
||||
*/
|
||||
@Schema(description ="标签编码")
|
||||
private String tagCode;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@Schema(description ="标签名称")
|
||||
private String tagName;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@Schema(description ="排序号")
|
||||
private Integer orderNumber;
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户分页实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 用户分页实体类
|
||||
* @create 2024/7/19 9:54
|
||||
**/
|
||||
@Data
|
||||
@Schema(description ="用户分页实体类")
|
||||
public class UserPageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description ="主键ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description ="用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description ="手机号")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description ="邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 状态 0:禁用 1:正常
|
||||
*/
|
||||
@Schema(description ="状态")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 状态 0:禁用 1:正常
|
||||
*/
|
||||
@Schema(description ="状态")
|
||||
private Integer enabled;
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.zlt.tourism.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 新增双轴视频或全景照片时验证返回实体类
|
||||
*
|
||||
* @author caiji
|
||||
* @version 1.0
|
||||
* @description 新增双轴视频或全景照片时验证返回实体类
|
||||
* @create 2024/8/14 10:30
|
||||
**/
|
||||
@Schema(description = "新增双轴视频或全景照片时验证返回实体类")
|
||||
@Data
|
||||
public class ValidScenicSpotVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 1、验证成功,-2:验证失败
|
||||
*/
|
||||
@Schema(description ="1、验证成功,-2:验证失败")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@Schema(description ="消息")
|
||||
private String msg;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
server:
|
||||
port: 8097
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: cultural-tourism-service
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
group: CULTURAL_TOURISM_GROUP
|
||||
|
||||
Reference in New Issue
Block a user