Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
rx
Commits
64045daa
Commit
64045daa
authored
Aug 28, 2024
by
wujipeng
Browse files
泵站污水厂列表查询
parent
8cfec9e6
Changes
8
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
64045daa
...
...
@@ -10,7 +10,7 @@
<description>
rx
</description>
<properties>
<java.version>
11
</java.version>
<java.version>
8
</java.version>
</properties>
<parent>
...
...
src/main/java/com/ruzhoukj/rx/controller/ProjectController.java
0 → 100644
View file @
64045daa
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
());
}
}
src/main/java/com/ruzhoukj/rx/dao/ProjectDao.java
0 → 100644
View file @
64045daa
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
>
{
}
src/main/java/com/ruzhoukj/rx/pojo/entity/ProjectEntity.java
0 → 100644
View file @
64045daa
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
;
}
src/main/java/com/ruzhoukj/rx/service/ProjectService.java
0 → 100644
View file @
64045daa
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
>
{
}
src/main/java/com/ruzhoukj/rx/service/impl/ProjectServiceImpl.java
0 → 100644
View file @
64045daa
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
{
}
src/main/java/com/ruzhoukj/rx/util/CoordinateConverter.java
0 → 100644
View file @
64045daa
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
};
}
}
src/main/resources/application.yml
View file @
64045daa
...
...
@@ -4,16 +4,16 @@ server:
spring
:
datasource
:
username
:
root
password
:
ruzhoukj@2022
password
:
RZKJ_0415$
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://
192.168.10.3
:330
7
/radio_station_network?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
url
:
jdbc:mysql://
t1.ruzhoukj.com
:330
6
/radio_station_network?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
data
:
mongodb
:
database
:
device_data
username
:
r
uzhoukj
password
:
r
uzhoukj@2023
username
:
r
oot
password
:
r
oot
port
:
27017
host
:
192.168.10.3
host
:
t1.ruzhoukj.com
authentication-database
:
admin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment