Commit 64045daa authored by wujipeng's avatar wujipeng
Browse files

泵站污水厂列表查询

parent 8cfec9e6
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<description>rx</description> <description>rx</description>
<properties> <properties>
<java.version>11</java.version> <java.version>8</java.version>
</properties> </properties>
<parent> <parent>
......
package com.ruzhoukj.rx.controller;
import com.ruzhoukj.rx.common.Result;
import com.ruzhoukj.rx.service.ProjectService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author wujipeng
* @version 1.0
* @create 2024-08-28 15:47
*/
@RestController
@RequestMapping("project")
public class ProjectController {
@Resource
ProjectService projectService;
@GetMapping("list")
public Result list() {
return Result.success(projectService.list());
}
}
package com.ruzhoukj.rx.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruzhoukj.rx.pojo.entity.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @author wujipeng
* @version 1.0
* @create 2024-08-28 15:45
*/
@Mapper
public interface ProjectDao extends BaseMapper<ProjectEntity> {
}
package com.ruzhoukj.rx.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author wujipeng
* @version 1.0
* @create 2024-08-28 15:42
*/
@TableName("project")
@Data
public class ProjectEntity {
@TableId(type = IdType.AUTO)
private Integer id;
private String name;
private Integer type;
private Double longitude;
private Double latitude;
}
package com.ruzhoukj.rx.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruzhoukj.rx.pojo.entity.ProjectEntity;
/**
* @author wujipeng
* @version 1.0
* @create 2024-08-28 15:45
*/
public interface ProjectService extends IService<ProjectEntity> {
}
package com.ruzhoukj.rx.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruzhoukj.rx.dao.ProjectDao;
import com.ruzhoukj.rx.pojo.entity.ProjectEntity;
import com.ruzhoukj.rx.service.ProjectService;
import org.springframework.stereotype.Service;
/**
* @author wujipeng
* @version 1.0
* @create 2024-08-28 15:46
*/
@Service
public class ProjectServiceImpl extends ServiceImpl<ProjectDao, ProjectEntity> implements ProjectService {
}
package com.ruzhoukj.rx.util;
import java.util.ArrayList;
import java.util.List;
public class CoordinateConverter {
private static final double X_PI = 3.14159265358979324 * 3000.0 / 180.0;
public static void main(String[] args) {
// 您的百度坐标列表
List<double[]> bdCoordinates = new ArrayList<>();
bdCoordinates.add(new double[]{121.230284, 31.317659}); // 安亭污水处理厂
bdCoordinates.add(new double[]{121.235602, 31.324138});
bdCoordinates.add(new double[]{121.24083, 31.324878});
bdCoordinates.add(new double[]{121.25161, 31.321546});
bdCoordinates.add(new double[]{121.253766, 31.326605});
bdCoordinates.add(new double[]{121.242124, 31.310564});
bdCoordinates.add(new double[]{121.23465, 31.293532});
bdCoordinates.add(new double[]{121.224589, 31.284521});
bdCoordinates.add(new double[]{121.196562, 31.27983});
bdCoordinates.add(new double[]{121.170008, 31.298808});
bdCoordinates.add(new double[]{121.183411, 31.299872});
bdCoordinates.add(new double[]{121.197317, 31.314358});
bdCoordinates.add(new double[]{121.200766, 31.33299});
bdCoordinates.add(new double[]{121.172164, 31.330769});
bdCoordinates.add(new double[]{121.198754, 31.309051});
bdCoordinates.add(new double[]{121.252077, 31.329782});
// 转换后的坐标列表
List<double[]> gcjCoordinates = new ArrayList<>();
// 执行坐标转换
for (double[] bdCoordinate : bdCoordinates) {
double[] gcjCoordinate = bd09ToGcj02(bdCoordinate[0], bdCoordinate[1]);
gcjCoordinates.add(gcjCoordinate);
}
// 输出转换后的坐标
for (double[] gcjCoordinate : gcjCoordinates) {
System.out.println("GCJ-02: " + gcjCoordinate[0] + ", " + gcjCoordinate[1]);
}
}
public static double[] bd09ToGcj02(double bdLon, double bdLat) {
double x = bdLon - 0.0065;
double y = bdLat - 0.006;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * X_PI);
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * X_PI);
double gcjLon = z * Math.cos(theta);
double gcjLat = z * Math.sin(theta);
return new double[]{gcjLon, gcjLat};
}
}
...@@ -4,16 +4,16 @@ server: ...@@ -4,16 +4,16 @@ server:
spring: spring:
datasource: datasource:
username: root username: root
password: ruzhoukj@2022 password: RZKJ_0415$
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.3:3307/radio_station_network?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true url: jdbc:mysql://t1.ruzhoukj.com:3306/radio_station_network?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
data: data:
mongodb: mongodb:
database: device_data database: device_data
username: ruzhoukj username: root
password: ruzhoukj@2023 password: root
port: 27017 port: 27017
host: 192.168.10.3 host: t1.ruzhoukj.com
authentication-database: admin authentication-database: admin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment