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
09c5fc13
Commit
09c5fc13
authored
Dec 12, 2024
by
zhouleilei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
cdb29710
0e2b705d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
2 deletions
+68
-2
GreenwaveHistRestServer.java
...ava/net/wanji/opt/controller/GreenwaveHistRestServer.java
+1
-1
CrossIndexController.java
.../wanji/opt/controller/signalopt/CrossIndexController.java
+17
-0
CrossIndexService.java
...rc/main/java/net/wanji/opt/service/CrossIndexService.java
+3
-0
CrossIndexServiceImpl.java
...ava/net/wanji/opt/service/impl/CrossIndexServiceImpl.java
+30
-0
RunningEvaluateServiceImpl.java
...et/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
+1
-1
crossStatusCountVO.java
...ce/src/main/java/net/wanji/opt/vo/crossStatusCountVO.java
+15
-0
GreenwaveHistMapper.xml
...service/src/main/resources/mapper/GreenwaveHistMapper.xml
+1
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/GreenwaveHistRestServer.java
View file @
09c5fc13
...
@@ -159,7 +159,7 @@ public class GreenwaveHistRestServer {
...
@@ -159,7 +159,7 @@ public class GreenwaveHistRestServer {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"绿波路口方向级->分粒度指标趋势"
,
notes
=
""
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"绿波路口方向级->分粒度指标趋势"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"13MOD0B5SI0"
),
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"13MOD0B5SI0"
),
@ApiImplicitParam
(
name
=
"groupType"
,
value
=
"时间粒度类型 1:15分钟粒度 2:30分钟粒度 3:小时粒度"
,
required
=
true
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"groupType"
,
value
=
"时间粒度类型
0:5分钟粒度
1:15分钟粒度 2:30分钟粒度 3:小时粒度"
,
required
=
true
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
false
,
dataType
=
"String"
,
defaultValue
=
"2024-12-04 00:00:00"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
false
,
dataType
=
"String"
,
defaultValue
=
"2024-12-04 00:00:00"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
false
,
dataType
=
"String"
,
defaultValue
=
"2024-12-05 00:00:00"
)
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
false
,
dataType
=
"String"
,
defaultValue
=
"2024-12-05 00:00:00"
)
})
})
...
...
signal-optimize-service/src/main/java/net/wanji/opt/controller/signalopt/CrossIndexController.java
View file @
09c5fc13
...
@@ -13,6 +13,7 @@ import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
...
@@ -13,6 +13,7 @@ import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import
net.wanji.opt.service.CrossIndexService
;
import
net.wanji.opt.service.CrossIndexService
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.crossStatusCountVO
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -101,4 +102,20 @@ public class CrossIndexController {
...
@@ -101,4 +102,20 @@ public class CrossIndexController {
return
JsonViewObject
.
newInstance
().
success
(
results
);
return
JsonViewObject
.
newInstance
().
success
(
results
);
}
}
@ApiOperation
(
value
=
"问题诊断"
,
notes
=
"优化监测-问题诊断"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@GetMapping
(
value
=
"/crossStatusCount"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AddOrUpdateSceneDTO
.
class
),
})
public
JsonViewObject
crossStatusCount
(
String
crossId
)
{
crossStatusCountVO
result
=
new
crossStatusCountVO
();
try
{
result
=
crossIndexService
.
crossStatusCount
(
crossId
);
}
catch
(
Exception
e
)
{
JsonViewObject
.
newInstance
().
fail
(
"优化监测-问题诊断"
);
}
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/CrossIndexService.java
View file @
09c5fc13
...
@@ -6,6 +6,7 @@ import net.wanji.databus.po.CrossDirDataRealtimePO;
...
@@ -6,6 +6,7 @@ import net.wanji.databus.po.CrossDirDataRealtimePO;
import
net.wanji.databus.po.TBaseCrossInfo
;
import
net.wanji.databus.po.TBaseCrossInfo
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.crossStatusCountVO
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -24,4 +25,6 @@ public interface CrossIndexService {
...
@@ -24,4 +25,6 @@ public interface CrossIndexService {
List
<
CrossOptResult
>
crossOptResultList
(
CrossIdBO
crossIdBO
)
throws
Exception
;
List
<
CrossOptResult
>
crossOptResultList
(
CrossIdBO
crossIdBO
)
throws
Exception
;
List
<
AIOptResultVO
>
crossAIList
();
List
<
AIOptResultVO
>
crossAIList
();
crossStatusCountVO
crossStatusCount
(
String
crossId
);
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/CrossIndexServiceImpl.java
View file @
09c5fc13
...
@@ -18,6 +18,7 @@ import net.wanji.opt.service.CrossIndexService;
...
@@ -18,6 +18,7 @@ import net.wanji.opt.service.CrossIndexService;
import
net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.AIOptResultVO
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.CrossOptResult
;
import
net.wanji.opt.vo.crossStatusCountVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -138,4 +139,33 @@ public class CrossIndexServiceImpl implements CrossIndexService {
...
@@ -138,4 +139,33 @@ public class CrossIndexServiceImpl implements CrossIndexService {
Collections
.
sort
(
results
,
Comparator
.
comparingInt
(
AIOptResultVO:
:
getOptStatus
));
Collections
.
sort
(
results
,
Comparator
.
comparingInt
(
AIOptResultVO:
:
getOptStatus
));
return
results
;
return
results
;
}
}
@Override
public
crossStatusCountVO
crossStatusCount
(
String
crossId
)
{
LocalDate
currentDate
=
LocalDate
.
now
();
LocalTime
startTime
=
LocalTime
.
MIDNIGHT
;
LocalDateTime
startOfDay
=
LocalDateTime
.
of
(
currentDate
,
startTime
);
LambdaQueryWrapper
<
StrategyCrossResultEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StrategyCrossResultEntity:
:
getCrossId
,
crossId
);
queryWrapper
.
ge
(
StrategyCrossResultEntity:
:
getIssueTime
,
startOfDay
);
List
<
StrategyCrossResultEntity
>
list
=
strategyCrossResultMapper
.
selectList
(
queryWrapper
);
crossStatusCountVO
crossStatusCountVO
=
new
crossStatusCountVO
();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
Integer
,
List
<
StrategyCrossResultEntity
>>
listMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
StrategyCrossResultEntity:
:
getCurrentAlgo
));
for
(
Map
.
Entry
<
Integer
,
List
<
StrategyCrossResultEntity
>>
entry
:
listMap
.
entrySet
())
{
Integer
currentAlgo
=
entry
.
getKey
();
List
<
StrategyCrossResultEntity
>
value
=
entry
.
getValue
();
if
(
Objects
.
equals
(
currentAlgo
,
CrossOptStrategyEnum
.
ONE
.
getCode
()))
{
crossStatusCountVO
.
setPhaseEmptyCount
(
value
.
size
());
}
if
(
Objects
.
equals
(
currentAlgo
,
CrossOptStrategyEnum
.
TWO
.
getCode
()))
{
crossStatusCountVO
.
setUnbalanceCount
(
value
.
size
());
}
if
(
Objects
.
equals
(
currentAlgo
,
CrossOptStrategyEnum
.
THREE
.
getCode
()))
{
crossStatusCountVO
.
setOverFlowCount
(
value
.
size
());
}
}
}
return
crossStatusCountVO
;
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
View file @
09c5fc13
...
@@ -169,7 +169,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -169,7 +169,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
total
+=
ServiceLevelEnum
.
getByType
(
key
).
getVal
()
*
entry1
.
getValue
().
size
();
total
+=
ServiceLevelEnum
.
getByType
(
key
).
getVal
()
*
entry1
.
getValue
().
size
();
}
}
int
avgService
=
(
int
)
Math
.
round
(
total
/
crossDataHistPOList
.
size
());
int
avgService
=
(
int
)
Math
.
round
(
total
/
crossDataHistPOList
.
size
());
String
serviceLevel
=
ServiceLevelEnum
.
getByVal
(
avgService
).
getType
();
String
serviceLevel
=
ServiceLevelEnum
.
getByVal
(
avgService
)
==
null
?
"A"
:
ServiceLevelEnum
.
getByVal
(
avgService
)
.
getType
();
vo
.
setServiceLevel
(
serviceLevel
);
vo
.
setServiceLevel
(
serviceLevel
);
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/crossStatusCountVO.java
0 → 100644
View file @
09c5fc13
package
net
.
wanji
.
opt
.
vo
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2024/12/11 22:50
*/
@Data
public
class
crossStatusCountVO
{
private
int
overFlowCount
;
private
int
unbalanceCount
;
private
int
phaseEmptyCount
;
private
int
congestionCount
;
}
signal-optimize-service/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
09c5fc13
...
@@ -111,6 +111,7 @@
...
@@ -111,6 +111,7 @@
(
(
SELECT start_time,
SELECT start_time,
(case
(case
when #{groupType}=0 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)))
when #{groupType}=1 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 900)
when #{groupType}=1 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 900)
when #{groupType}=2 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 1800)
when #{groupType}=2 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 1800)
when #{groupType}=3 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 3600)
when #{groupType}=3 then CEIL(UNIX_TIMESTAMP(DATE_ADD(t.start_time,INTERVAL 5 MINUTE)) / 3600)
...
...
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