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
ecb1ffa0
Commit
ecb1ffa0
authored
Jul 23, 2026
by
wujipeng
Browse files
修复相关
parent
9fb61cd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/example/pipelinenetwork/service/impl/BasicServiceImpl.java
View file @
ecb1ffa0
...
...
@@ -6,8 +6,10 @@ import com.example.pipelinenetwork.mapper.BasicMapper;
import
com.example.pipelinenetwork.pojo.dto.RoadDTO
;
import
com.example.pipelinenetwork.pojo.entity.BasicEntity
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
com.example.pipelinenetwork.pojo.entity.RepairEntity
;
import
com.example.pipelinenetwork.service.BasicService
;
import
com.example.pipelinenetwork.service.DefectService
;
import
com.example.pipelinenetwork.service.RepairService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -26,6 +28,8 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
@Resource
private
DefectService
defectService
;
@Resource
private
RepairService
repairService
;
@Override
public
Map
<
String
,
Integer
>
roadDetail
(
RoadDTO
roadDTO
)
{
...
...
@@ -45,7 +49,17 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
}
}
}
else
if
(
"修复"
.
equals
(
roadDTO
.
getType
()))
{
List
<
RepairEntity
>
repairList
=
repairService
.
list
(
new
LambdaQueryWrapper
<
RepairEntity
>()
.
in
(
RepairEntity:
:
getRelId
,
relIds
).
eq
(
RepairEntity:
:
getType
,
roadDTO
.
getDefectType
())
.
eq
(
RepairEntity:
:
getLevel
,
roadDTO
.
getLev
())
);
for
(
RepairEntity
repairEntity
:
repairList
)
{
if
(
result
.
containsKey
(
repairEntity
.
getName
()))
{
result
.
put
(
repairEntity
.
getName
(),
result
.
get
(
repairEntity
.
getName
())
+
repairEntity
.
getNum
());
}
else
{
result
.
put
(
repairEntity
.
getName
(),
repairEntity
.
getNum
());
}
}
}
return
result
;
}
...
...
@@ -78,7 +92,23 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
}
});
}
else
if
(
"修复"
.
equals
(
type
))
{
List
<
RepairEntity
>
repairList
=
repairService
.
list
();
Map
<
String
,
Integer
>
repairMap
=
new
HashMap
<>();
for
(
RepairEntity
repairEntity
:
repairList
)
{
if
(
repairMap
.
containsKey
(
repairEntity
.
getRelId
()))
{
repairMap
.
put
(
repairEntity
.
getRelId
(),
repairMap
.
get
(
repairEntity
.
getRelId
())
+
repairEntity
.
getNum
());
}
else
{
repairMap
.
put
(
repairEntity
.
getRelId
(),
repairEntity
.
getNum
());
}
}
basicMap
.
forEach
((
key
,
value
)
->
{
if
(
repairMap
.
containsKey
(
key
))
{
Integer
i
=
repairMap
.
get
(
key
);
result
.
put
(
value
,
i
);
}
else
{
result
.
put
(
value
,
0
);
}
});
}
return
result
;
}
...
...
src/main/java/com/example/pipelinenetwork/service/impl/RoadServiceImpl.java
View file @
ecb1ffa0
...
...
@@ -6,11 +6,13 @@ import com.example.pipelinenetwork.mapper.RoadMapper;
import
com.example.pipelinenetwork.pojo.dto.RoadDTO
;
import
com.example.pipelinenetwork.pojo.entity.BasicEntity
;
import
com.example.pipelinenetwork.pojo.entity.DefectEntity
;
import
com.example.pipelinenetwork.pojo.entity.RepairEntity
;
import
com.example.pipelinenetwork.pojo.entity.RoadEntity
;
import
com.example.pipelinenetwork.pojo.vo.RoadVO
;
import
com.example.pipelinenetwork.result.Result
;
import
com.example.pipelinenetwork.service.BasicService
;
import
com.example.pipelinenetwork.service.DefectService
;
import
com.example.pipelinenetwork.service.RepairService
;
import
com.example.pipelinenetwork.service.RoadService
;
import
com.example.pipelinenetwork.util.LinestringUtil
;
import
com.example.pipelinenetwork.util.NumberUtils
;
...
...
@@ -34,6 +36,8 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
private
BasicService
basicService
;
@Resource
private
DefectService
defectService
;
@Resource
private
RepairService
repairService
;
@Override
public
RoadVO
match
(
Double
lng
,
Double
lat
)
{
...
...
@@ -108,7 +112,24 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
}
}
}
else
if
(
"修复"
.
equals
(
roadDTO
.
getType
()))
{
List
<
RepairEntity
>
repairList
=
repairService
.
list
(
new
LambdaQueryWrapper
<
RepairEntity
>()
.
in
(
RepairEntity:
:
getRelId
,
relIds
).
eq
(
RepairEntity:
:
getLevel
,
roadDTO
.
getLev
())
);
for
(
RepairEntity
repairEntity
:
repairList
)
{
if
(
"结构性"
.
equals
(
repairEntity
.
getType
()))
{
structuralDefect
++;
}
else
if
(
"功能性"
.
equals
(
repairEntity
.
getType
()))
{
functionalDefect
++;
}
if
(
roadDTO
.
getDefectType
().
equals
(
repairEntity
.
getType
())){
RoadVO
roadVO
=
new
RoadVO
();
roadVO
.
setDefectType
(
repairEntity
.
getType
());
roadVO
.
setDefectName
(
repairEntity
.
getName
());
roadVO
.
setDefectNum
(
repairEntity
.
getNum
());
roadVO
.
setDefectLev
(
repairEntity
.
getLevel
());
data
.
add
(
roadVO
);
}
}
}
result
.
setPipeNum
(
pipeNum
);
result
.
setLength
(
length
);
...
...
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