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
03350324
Commit
03350324
authored
Dec 07, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] AI路口干线优化
parent
f145ee10
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+4
-0
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+1
-1
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+3
-3
GreenwaveListVO.java
...s/src/main/java/net/wanji/databus/vo/GreenwaveListVO.java
+2
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
03350324
...
@@ -202,6 +202,9 @@ public class TrendServiceImpl implements TrendService {
...
@@ -202,6 +202,9 @@ public class TrendServiceImpl implements TrendService {
Integer
greenId
=
entry
.
getKey
();
Integer
greenId
=
entry
.
getKey
();
List
<
GreenwaveListVO
>
value
=
entry
.
getValue
();
List
<
GreenwaveListVO
>
value
=
entry
.
getValue
();
if
(
Objects
.
equals
(
1
,
value
.
size
()))
{
if
(
Objects
.
equals
(
1
,
value
.
size
()))
{
value
.
forEach
(
vo
->
{
vo
.
setType
(
"单向绿波"
);
});
greenwaveListVOList
.
addAll
(
value
);
greenwaveListVOList
.
addAll
(
value
);
}
}
if
(
Objects
.
equals
(
2
,
value
.
size
()))
{
if
(
Objects
.
equals
(
2
,
value
.
size
()))
{
...
@@ -227,6 +230,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -227,6 +230,7 @@ public class TrendServiceImpl implements TrendService {
wDirVo
.
setStopTimes
((
int
)
(
stopTimes
/
2
));
wDirVo
.
setStopTimes
((
int
)
(
stopTimes
/
2
));
wDirVo
.
setTrafficIndex
(
trafficIndex
/
2
<
1
?
1
:
trafficIndex
/
2
);
wDirVo
.
setTrafficIndex
(
trafficIndex
/
2
<
1
?
1
:
trafficIndex
/
2
);
wDirVo
.
setTravelTime
(
travelTime
/
2
);
wDirVo
.
setTravelTime
(
travelTime
/
2
);
wDirVo
.
setType
(
"双向绿波"
);
greenwaveListVOList
.
add
(
wDirVo
);
greenwaveListVOList
.
add
(
wDirVo
);
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
03350324
...
@@ -7,8 +7,8 @@ import io.swagger.annotations.ApiResponses;
...
@@ -7,8 +7,8 @@ import io.swagger.annotations.ApiResponses;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyControlVO
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
03350324
...
@@ -352,8 +352,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -352,8 +352,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
StrategyControlDataEntity
result
=
new
StrategyControlDataEntity
();
StrategyControlDataEntity
result
=
new
StrategyControlDataEntity
();
BeanUtils
.
copyProperties
(
entity
,
result
);
BeanUtils
.
copyProperties
(
entity
,
result
);
String
time
=
entity
.
getTime
();
String
time
=
entity
.
getTime
();
List
<
StrategyControlDataVO
.
TimeTable
>
timeTables
=
instance
.
readValue
(
time
,
new
TypeReference
<
List
<
StrategyControlDataVO
.
TimeTable
>>()
{
List
<
StrategyControlDataVO
.
TimeTable
>
timeTables
=
instance
.
readValue
(
time
,
new
TypeReference
<
List
<
StrategyControlDataVO
.
TimeTable
>>()
{});
});
for
(
StrategyControlDataVO
.
TimeTable
timeTable
:
timeTables
)
{
for
(
StrategyControlDataVO
.
TimeTable
timeTable
:
timeTables
)
{
int
currentWeek
=
DateUtil
.
thisDayOfWeek
()
-
1
;
int
currentWeek
=
DateUtil
.
thisDayOfWeek
()
-
1
;
String
[]
timeList
=
timeTable
.
getTimeList
();
String
[]
timeList
=
timeTable
.
getTimeList
();
...
@@ -370,12 +369,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -370,12 +369,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
DateTime
currentTime
=
DateUtil
.
parse
(
format
,
"HH:mm"
);
DateTime
currentTime
=
DateUtil
.
parse
(
format
,
"HH:mm"
);
DateTime
startHourDate
=
DateUtil
.
parse
(
startHour
,
"HH:mm"
);
DateTime
startHourDate
=
DateUtil
.
parse
(
startHour
,
"HH:mm"
);
DateTime
endHourDate
=
DateUtil
.
parse
(
entHour
,
"HH:mm"
);
DateTime
endHourDate
=
DateUtil
.
parse
(
entHour
,
"HH:mm"
);
if
(
currentTime
.
after
(
startHourDate
)
&&
currentTime
.
b
efore
(
endHourDate
))
{
if
(
currentTime
.
isAfter
(
startHourDate
)
&&
currentTime
.
isB
efore
(
endHourDate
))
{
result
.
setTime
(
hour
);
result
.
setTime
(
hour
);
result
.
setStatus
(
1
);
result
.
setStatus
(
1
);
}
else
{
}
else
{
// 如果有调度策略在执行,设置为开启,否则关闭,提供前端过滤配置和未配置
// 如果有调度策略在执行,设置为开启,否则关闭,提供前端过滤配置和未配置
result
.
setStatus
(
0
);
result
.
setStatus
(
0
);
result
.
setTime
(
null
);
}
}
}
}
}
}
...
...
wj-databus/src/main/java/net/wanji/databus/vo/GreenwaveListVO.java
View file @
03350324
...
@@ -18,6 +18,8 @@ import java.util.List;
...
@@ -18,6 +18,8 @@ import java.util.List;
public
class
GreenwaveListVO
{
public
class
GreenwaveListVO
{
@ApiModelProperty
(
value
=
"绿波ID"
)
@ApiModelProperty
(
value
=
"绿波ID"
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"绿波方向类型"
)
private
String
type
;
@ApiModelProperty
(
value
=
"子区名称"
)
@ApiModelProperty
(
value
=
"子区名称"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
value
=
"协调方式:0未开启;1相位差优化;2选择方案"
)
@ApiModelProperty
(
value
=
"协调方式:0未开启;1相位差优化;2选择方案"
)
...
...
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