Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
signal
traffic-signal-platform
Commits
84817317
Commit
84817317
authored
Aug 21, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 新信号评价-运行评价-路口列表
parent
bf0a2bf1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
163 additions
and
3 deletions
+163
-3
CrossNameBO.java
...e-service/src/main/java/net/wanji/opt/bo/CrossNameBO.java
+16
-0
EvaluateController.java
...ain/java/net/wanji/opt/controller/EvaluateController.java
+3
-3
RunningEvaluateController.java
...a/net/wanji/opt/controller/RunningEvaluateController.java
+45
-0
RunningEvaluateService.java
...in/java/net/wanji/opt/service/RunningEvaluateService.java
+11
-0
RunningEvaluateServiceImpl.java
...et/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
+42
-0
CrossDataRealtimeMapper.java
...net/wanji/databus/dao/mapper/CrossDataRealtimeMapper.java
+5
-0
RunningEvaluateCrossListVO.java
...java/net/wanji/databus/vo/RunningEvaluateCrossListVO.java
+26
-0
CrossDataRealtimeMapper.xml
...bus/src/main/resources/mapper/CrossDataRealtimeMapper.xml
+15
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/bo/CrossNameBO.java
0 → 100644
View file @
84817317
package
net
.
wanji
.
opt
.
bo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author Kent HAN
* @date 2023/6/9 13:52
*/
@Data
@ApiModel
(
value
=
"CrossNameBO"
,
description
=
"路口名称"
)
public
class
CrossNameBO
{
@ApiModelProperty
(
value
=
"路口名称"
)
private
String
crossName
;
}
signal-optimize-service/src/main/java/net/wanji/opt/controller/EvaluateController.java
View file @
84817317
...
@@ -21,7 +21,7 @@ import javax.ws.rs.core.MediaType;
...
@@ -21,7 +21,7 @@ import javax.ws.rs.core.MediaType;
*
*
* @author Kent HAN
* @author Kent HAN
*/
*/
@Api
(
value
=
"EvaluateController"
,
description
=
"信号评价"
)
@Api
(
value
=
"EvaluateController"
,
description
=
"信号评价
(旧)
"
)
@RequestMapping
(
"/evaluate"
)
@RequestMapping
(
"/evaluate"
)
@RestController
@RestController
public
class
EvaluateController
{
public
class
EvaluateController
{
...
@@ -32,7 +32,7 @@ public class EvaluateController {
...
@@ -32,7 +32,7 @@ public class EvaluateController {
this
.
evaluateService
=
evaluateService
;
this
.
evaluateService
=
evaluateService
;
}
}
@ApiOperation
(
value
=
"路口详情
"
,
notes
=
"路口详情
"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"路口详情
(旧)"
,
notes
=
"路口详情(旧)
"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/evaluateCrossDetail"
,
@PostMapping
(
value
=
"/evaluateCrossDetail"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
@@ -44,7 +44,7 @@ public class EvaluateController {
...
@@ -44,7 +44,7 @@ public class EvaluateController {
return
JsonViewObject
.
newInstance
().
success
(
evaluateCrossDetailVO
);
return
JsonViewObject
.
newInstance
().
success
(
evaluateCrossDetailVO
);
}
}
@ApiOperation
(
value
=
"评价指标
"
,
notes
=
"评价指标
"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"评价指标
(旧)"
,
notes
=
"评价指标(旧)
"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/evaluateMetrics"
,
@PostMapping
(
value
=
"/evaluateMetrics"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/controller/RunningEvaluateController.java
0 → 100644
View file @
84817317
package
net
.
wanji
.
opt
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.bo.CrossNameBO
;
import
net.wanji.opt.service.impl.RunningEvaluateServiceImpl
;
import
net.wanji.databus.vo.RunningEvaluateCrossListVO
;
import
org.springframework.web.bind.annotation.*
;
import
javax.ws.rs.core.MediaType
;
import
java.util.List
;
/**
* 运行评价
*
* @author Kent HAN
*/
@Api
(
value
=
"RunningEvaluateController"
,
description
=
"运行评价"
)
@RequestMapping
(
"/runningEvaluate"
)
@RestController
public
class
RunningEvaluateController
{
private
final
RunningEvaluateServiceImpl
runningEvaluateService
;
public
RunningEvaluateController
(
RunningEvaluateServiceImpl
runningEvaluateService
)
{
this
.
runningEvaluateService
=
runningEvaluateService
;
}
@ApiOperation
(
value
=
"路口列表"
,
notes
=
"路口列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/crossList"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RunningEvaluateCrossListVO
.
class
),
})
public
JsonViewObject
crossList
(
@RequestBody
CrossNameBO
crossNameBO
)
{
List
<
RunningEvaluateCrossListVO
>
res
=
runningEvaluateService
.
crossList
(
crossNameBO
);
return
JsonViewObject
.
newInstance
().
success
(
res
);
}
}
\ No newline at end of file
signal-optimize-service/src/main/java/net/wanji/opt/service/RunningEvaluateService.java
0 → 100644
View file @
84817317
package
net
.
wanji
.
opt
.
service
;
import
net.wanji.databus.vo.RunningEvaluateCrossListVO
;
import
net.wanji.opt.bo.CrossNameBO
;
import
java.util.List
;
public
interface
RunningEvaluateService
{
List
<
RunningEvaluateCrossListVO
>
crossList
(
CrossNameBO
crossNameBO
);
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
0 → 100644
View file @
84817317
package
net
.
wanji
.
opt
.
service
.
impl
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.utils.tool.CrossUtil
;
import
net.wanji.databus.dao.mapper.CrossDataRealtimeMapper
;
import
net.wanji.databus.vo.RunningEvaluateCrossListVO
;
import
net.wanji.opt.bo.CrossNameBO
;
import
net.wanji.opt.service.RunningEvaluateService
;
import
org.springframework.stereotype.Service
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author Kent HAN
* @date 2023/8/21 9:53
*/
@Slf4j
@Service
public
class
RunningEvaluateServiceImpl
implements
RunningEvaluateService
{
private
final
CrossDataRealtimeMapper
crossDataRealtimeMapper
;
public
RunningEvaluateServiceImpl
(
CrossDataRealtimeMapper
crossDataRealtimeMapper
)
{
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
}
@Override
public
List
<
RunningEvaluateCrossListVO
>
crossList
(
CrossNameBO
crossNameBO
)
{
String
crossName
=
crossNameBO
.
getCrossName
();
List
<
RunningEvaluateCrossListVO
>
crossDataRealtimePOList
=
crossDataRealtimeMapper
.
selectByCrossName
(
crossName
);
for
(
RunningEvaluateCrossListVO
runningEvaluateCrossListVO
:
crossDataRealtimePOList
)
{
Double
sturation
=
runningEvaluateCrossListVO
.
getSturation
();
runningEvaluateCrossListVO
.
setServiceLevel
(
CrossUtil
.
getServiceLevel
(
sturation
));
}
// 按服务水平降序排序
List
<
RunningEvaluateCrossListVO
>
res
=
crossDataRealtimePOList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
RunningEvaluateCrossListVO:
:
getSturation
).
reversed
())
.
collect
(
Collectors
.
toList
());
return
res
;
}
}
wj-databus/src/main/java/net/wanji/databus/dao/mapper/CrossDataRealtimeMapper.java
View file @
84817317
...
@@ -3,6 +3,7 @@ package net.wanji.databus.dao.mapper;
...
@@ -3,6 +3,7 @@ package net.wanji.databus.dao.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
net.wanji.databus.po.CrossDataRealtimePO
;
import
net.wanji.databus.po.CrossDataRealtimePO
;
import
net.wanji.databus.vo.AbnormalCrossListVO
;
import
net.wanji.databus.vo.AbnormalCrossListVO
;
import
net.wanji.databus.vo.RunningEvaluateCrossListVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -22,4 +23,8 @@ public interface CrossDataRealtimeMapper extends BaseMapper<CrossDataRealtimePO>
...
@@ -22,4 +23,8 @@ public interface CrossDataRealtimeMapper extends BaseMapper<CrossDataRealtimePO>
List
<
AbnormalCrossListVO
>
selectAbnormalCross
(
Integer
status
,
String
name
,
Integer
type
);
List
<
AbnormalCrossListVO
>
selectAbnormalCross
(
Integer
status
,
String
name
,
Integer
type
);
CrossDataRealtimePO
selectByCrossId
(
String
crossId
);
CrossDataRealtimePO
selectByCrossId
(
String
crossId
);
List
<
CrossDataRealtimePO
>
selectAll
();
List
<
RunningEvaluateCrossListVO
>
selectByCrossName
(
String
crossName
);
}
}
wj-databus/src/main/java/net/wanji/databus/vo/RunningEvaluateCrossListVO.java
0 → 100644
View file @
84817317
package
net
.
wanji
.
databus
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Kent HAN
* @date 2023/2/9 8:38
*/
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"RunningEvaluateCrossListVO"
,
description
=
"运行评价-路口列表VO"
)
public
class
RunningEvaluateCrossListVO
{
@ApiModelProperty
(
value
=
"路口ID"
)
private
String
crossId
;
@ApiModelProperty
(
value
=
"路口名称"
)
private
String
crossName
;
@ApiModelProperty
(
name
=
"饱和度"
)
private
Double
sturation
;
@ApiModelProperty
(
value
=
"服务水平"
)
String
serviceLevel
;
}
wj-databus/src/main/resources/mapper/CrossDataRealtimeMapper.xml
View file @
84817317
...
@@ -86,4 +86,19 @@
...
@@ -86,4 +86,19 @@
where cross_id = #{crossId}
where cross_id = #{crossId}
</select>
</select>
<select
id=
"selectAll"
resultType=
"net.wanji.databus.po.CrossDataRealtimePO"
>
select
<include
refid=
"Base_Column_List"
></include>
from t_cross_data_realtime
</select>
<select
id=
"selectByCrossName"
resultType=
"net.wanji.databus.vo.RunningEvaluateCrossListVO"
>
select t1.cross_id as crossId, t1.sturation as sturation, t2.name as crossName
from t_cross_data_realtime t1 join t_base_cross_info t2 on t1.cross_id = t2.id
<where>
<if
test=
"crossName != null and crossName != ''"
>
AND t2.name LIKE CONCAT('%',#{crossName},'%')
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
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