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
65ece192
Commit
65ece192
authored
Jul 22, 2026
by
wujipeng
Browse files
各路段检测修复汇总
parent
a75d1380
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/example/pipelinenetwork/controller/RoadController.java
View file @
65ece192
...
...
@@ -37,7 +37,7 @@ public class RoadController {
* 详情查询
*/
@PostMapping
(
"/detail"
)
public
Result
<
Map
<
String
,
Integer
>>
roadDetail
(
@RequestBody
RoadDTO
roadDTO
)
{
public
Result
<
Map
<
String
,
Integer
>>
roadDetail
(
@RequestBody
RoadDTO
roadDTO
)
{
return
Result
.
success
(
roadService
.
roadDetail
(
roadDTO
));
}
...
...
@@ -49,5 +49,11 @@ public class RoadController {
return
Result
.
success
(
roadService
.
queryByRoadName
(
roadDTO
));
}
/**
* 各路段检测修复汇总
*/
@GetMapping
(
"/road/summary"
)
public
Result
<
Map
<
String
,
Integer
>>
roadSummary
(
@RequestParam
(
name
=
"type"
)
String
type
)
{
return
Result
.
success
(
roadService
.
roadSummary
(
type
));
}
}
\ No newline at end of file
src/main/java/com/example/pipelinenetwork/service/RoadService.java
View file @
65ece192
...
...
@@ -25,4 +25,6 @@ public interface RoadService extends IService<RoadEntity> {
RoadVO
queryByRoadName
(
RoadDTO
roadDTO
);
Map
<
String
,
Integer
>
roadSummary
(
String
type
);
}
src/main/java/com/example/pipelinenetwork/service/impl/RoadServiceImpl.java
View file @
65ece192
...
...
@@ -127,6 +127,36 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
return
result
;
}
@Override
public
Map
<
String
,
Integer
>
roadSummary
(
String
type
)
{
Map
<
String
,
Integer
>
result
=
new
HashMap
<>();
//获取基础信息
List
<
BasicEntity
>
basicList
=
basicService
.
list
();
for
(
BasicEntity
basicEntity
:
basicList
)
{
result
.
put
(
basicEntity
.
getRoadName
(),
0
);
}
if
(
"检测"
.
equals
(
type
))
{
List
<
DefectEntity
>
defectList
=
defectService
.
list
();
Map
<
String
,
Integer
>
defectMap
=
new
HashMap
<>();
for
(
DefectEntity
defectEntity
:
defectList
)
{
if
(
defectMap
.
containsKey
(
defectEntity
.
getRelId
()))
{
defectMap
.
put
(
defectEntity
.
getRelId
(),
defectMap
.
get
(
defectEntity
.
getRelId
())
+
defectEntity
.
getNum
());
}
else
{
defectMap
.
put
(
defectEntity
.
getRelId
(),
defectEntity
.
getNum
());
}
}
result
.
forEach
((
key
,
value
)
->
{
if
(
defectMap
.
containsKey
(
key
)){
Integer
i
=
defectMap
.
get
(
key
);
result
.
put
(
key
,
i
);
}
});
}
else
if
(
"修复"
.
equals
(
type
))
{
}
return
result
;
}
/**
* 解析Excel并生成SQL语句(不执行)
*/
...
...
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