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
邬吉朋
pipeline-network
Commits
b74bcf3f
Commit
b74bcf3f
authored
Jul 20, 2026
by
wujipeng
Browse files
init
parents
Pipeline
#340
failed with stages
in 0 seconds
Changes
24
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitattributes
0 → 100644
View file @
b74bcf3f
/mvnw text eol=lf
*.cmd text eol=crlf
.gitignore
0 → 100644
View file @
b74bcf3f
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
.mvn/wrapper/maven-wrapper.properties
0 → 100644
View file @
b74bcf3f
wrapperVersion
=
3.3.4
distributionType
=
only-script
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
pom.xml
0 → 100644
View file @
b74bcf3f
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.7.6
</version>
<relativePath/>
</parent>
<groupId>
com.example
</groupId>
<artifactId>
pipeline-network
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>
com.mysql
</groupId>
<artifactId>
mysql-connector-j
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.5.15
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.8.38
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
<version>
5.2.5
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
5.2.5
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.83
</version>
</dependency>
<dependency>
<groupId>
org.locationtech.jts
</groupId>
<artifactId>
jts-core
</artifactId>
<version>
1.19.0
</version>
<!-- 或最新版 -->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.7.6
</version>
<configuration>
<mainClass>
com.example.pipelinenetwork.PipelineNetworkApplication
</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
src/main/java/com/example/pipelinenetwork/PipelineNetworkApplication.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
@MapperScan
(
"com.example.pipelinenetwork.mapper"
)
public
class
PipelineNetworkApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
PipelineNetworkApplication
.
class
,
args
);
}
}
src/main/java/com/example/pipelinenetwork/controller/RoadController.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.controller
;
import
com.example.pipelinenetwork.pojo.vo.RoadVO
;
import
com.example.pipelinenetwork.result.Result
;
import
com.example.pipelinenetwork.service.DefectService
;
import
com.example.pipelinenetwork.service.DetectionService
;
import
com.example.pipelinenetwork.service.RoadService
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/road"
)
public
class
RoadController
{
@Resource
private
RoadService
roadService
;
@Resource
private
DetectionService
detectionService
;
@Resource
private
DefectService
defectService
;
@GetMapping
(
"/match"
)
public
Result
<
RoadVO
>
match
(
@RequestParam
Double
lng
,
@RequestParam
Double
lat
)
{
return
Result
.
success
(
roadService
.
match
(
lng
,
lat
));
}
/**
* 上传Excel文件并生成sql语句
*/
@PostMapping
(
"/import"
)
public
List
<
String
>
importRoadData
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
return
roadService
.
importRoadData
(
file
);
}
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/mapper/DefectMapper.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:52
* @Version: 1.0
*/
@Mapper
public
interface
DefectMapper
extends
BaseMapper
<
DefectEntity
>
{
}
src/main/java/com/example/pipelinenetwork/mapper/DetectionMapper.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.pipelinenetwork.pojo.entity.DetectionEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:58
* @Version: 1.0
*/
@Mapper
public
interface
DetectionMapper
extends
BaseMapper
<
DetectionEntity
>
{
}
src/main/java/com/example/pipelinenetwork/mapper/RoadMapper.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.pipelinenetwork.pojo.entity.RoadEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
@Mapper
public
interface
RoadMapper
extends
BaseMapper
<
RoadEntity
>
{
/**
* 根据经纬度匹配最近的路段
*/
Map
<
String
,
Object
>
matchNearestRoad
(
@Param
(
"lng"
)
Double
lng
,
@Param
(
"lat"
)
Double
lat
);
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/pojo/entity/DefectEntity.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.pojo.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
"defect"
)
public
class
DefectEntity
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 缺陷类型
*/
private
String
type
;
/**
* 缺陷名称
*/
private
String
name
;
/**
* 缺陷等级
*/
private
String
level
;
/**
* 缺陷数量
*/
private
Integer
num
;
}
src/main/java/com/example/pipelinenetwork/pojo/entity/DetectionEntity.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.pojo.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@TableName
(
"detection"
)
public
class
DetectionEntity
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 地区
*/
private
String
region
;
/**
* 报告名称
*/
private
String
reportName
;
/**
* 路名
*/
private
String
roadName
;
/**
* 管道数量
*/
private
Integer
pipeNum
;
/**
* 管道长度
*/
private
Double
pipeLength
;
/**
* 缺陷数量
*/
private
Integer
defectNum
;
}
src/main/java/com/example/pipelinenetwork/pojo/entity/RoadEntity.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.pojo.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
"road"
)
public
class
RoadEntity
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
private
String
name
;
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/pojo/vo/RoadVO.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.pojo.vo
;
import
com.example.pipelinenetwork.pojo.entity.RoadEntity
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.*
;
import
java.util.List
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
RoadVO
extends
RoadEntity
{
/**
* 是否匹配到路段
*/
private
boolean
found
;
/**
* 点击位置到路段的距离(单位:米)
*/
private
Double
distance
;
/**
* 经度
*/
private
Double
lng
;
/**
* 纬度
*/
private
Double
lat
;
/**
* 匹配到的路段的坐标列表
*/
private
List
<
List
<
Double
>>
coordinates
;
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/result/PageResult.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.result
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
PageResult
<
T
>
{
/**
* 响应码
*/
private
Integer
code
;
/**
* 当前页码
*/
private
Integer
pageNum
;
/**
* 每页数量
*/
private
Integer
pageSize
;
/**
* 总页数
*/
private
Integer
totalPages
;
/**
* 总记录数
*/
private
Long
total
;
/**
* 数据列表
*/
private
List
<
T
>
data
;
// 构造方法
public
PageResult
(
Integer
pageNum
,
Integer
pageSize
,
Long
total
,
List
<
T
>
data
)
{
this
.
code
=
200
;
this
.
pageNum
=
pageNum
;
this
.
pageSize
=
pageSize
;
this
.
total
=
total
;
this
.
data
=
data
;
this
.
totalPages
=
(
int
)
Math
.
ceil
((
double
)
total
/
pageSize
);
}
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/result/Result.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.result
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 统一响应结果封装类
*/
@Data
public
class
Result
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 响应码
*/
private
Integer
code
;
/**
* 响应消息
*/
private
String
message
;
/**
* 响应数据
*/
private
T
data
;
/**
* 响应时间戳
*/
private
Long
timestamp
;
/**
* 构造方法
*/
private
Result
()
{
this
.
timestamp
=
System
.
currentTimeMillis
();
}
/**
* 成功响应
*/
public
static
<
T
>
Result
<
T
>
success
()
{
return
success
(
null
);
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
200
);
result
.
setMessage
(
"操作成功"
);
result
.
setData
(
data
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
,
String
message
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
200
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
/**
* 失败响应
*/
public
static
<
T
>
Result
<
T
>
error
()
{
return
error
(
500
,
"操作失败"
);
}
public
static
<
T
>
Result
<
T
>
error
(
String
message
)
{
return
error
(
500
,
message
);
}
public
static
<
T
>
Result
<
T
>
error
(
Integer
code
,
String
message
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
code
);
result
.
setMessage
(
message
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
error
(
Integer
code
,
String
message
,
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
code
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
/**
* 通用状态码响应
*/
public
static
<
T
>
Result
<
T
>
of
(
Integer
status
,
String
message
,
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
status
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
of
(
Integer
status
,
String
message
)
{
return
of
(
status
,
message
,
null
);
}
/**
* 便捷方法
*/
public
static
<
T
>
Result
<
T
>
ok
()
{
return
success
();
}
public
static
<
T
>
Result
<
T
>
ok
(
T
data
)
{
return
success
(
data
);
}
public
static
<
T
>
Result
<
T
>
ok
(
T
data
,
String
message
)
{
return
success
(
data
,
message
);
}
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/service/DefectService.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:52
* @Version: 1.0
*/
public
interface
DefectService
extends
IService
<
DefectEntity
>
{
}
src/main/java/com/example/pipelinenetwork/service/DetectionService.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.example.pipelinenetwork.pojo.entity.DetectionEntity
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:59
* @Version: 1.0
*/
public
interface
DetectionService
extends
IService
<
DetectionEntity
>
{
}
src/main/java/com/example/pipelinenetwork/service/RoadService.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.example.pipelinenetwork.pojo.vo.RoadVO
;
import
com.example.pipelinenetwork.pojo.entity.RoadEntity
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 10:55
* @Version: 1.0
*/
public
interface
RoadService
extends
IService
<
RoadEntity
>
{
RoadVO
match
(
Double
lng
,
Double
lat
);
List
<
String
>
importRoadData
(
MultipartFile
file
)
throws
Exception
;
}
src/main/java/com/example/pipelinenetwork/service/impl/DefectServiceImpl.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.example.pipelinenetwork.mapper.DefectMapper
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
com.example.pipelinenetwork.service.DefectService
;
import
org.springframework.stereotype.Service
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:53
* @Version: 1.0
*/
@Service
public
class
DefectServiceImpl
extends
ServiceImpl
<
DefectMapper
,
DefectEntity
>
implements
DefectService
{
}
src/main/java/com/example/pipelinenetwork/service/impl/DetectionServiceImpl.java
0 → 100644
View file @
b74bcf3f
package
com.example.pipelinenetwork.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.example.pipelinenetwork.mapper.DetectionMapper
;
import
com.example.pipelinenetwork.pojo.entity.DetectionEntity
;
import
com.example.pipelinenetwork.service.DetectionService
;
import
org.springframework.stereotype.Service
;
/**
* @Author: wujipeng
* @Description: TODO
* @Date: 2026/7/20 13:59
* @Version: 1.0
*/
@Service
public
class
DetectionServiceImpl
extends
ServiceImpl
<
DetectionMapper
,
DetectionEntity
>
implements
DetectionService
{
}
Prev
1
2
Next
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