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
33295e5d
Commit
33295e5d
authored
Nov 23, 2024
by
zhouleilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
灯态优化
parent
4989b034
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
70 deletions
+69
-70
ControlCommandServiceImpl.java
...i/utc/hisense/service/impl/ControlCommandServiceImpl.java
+0
-10
HisensePhaseCountDownTask.java
...net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
+67
-58
LocalDateTimeUtil.java
...n/java/net/wanji/common/utils/tool/LocalDateTimeUtil.java
+1
-0
TempSchemeSendVO.java
.../src/main/java/net/wanji/databus/vo/TempSchemeSendVO.java
+1
-2
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/service/impl/ControlCommandServiceImpl.java
View file @
33295e5d
...
@@ -295,16 +295,6 @@ public class ControlCommandServiceImpl implements ControlCommandService {
...
@@ -295,16 +295,6 @@ public class ControlCommandServiceImpl implements ControlCommandService {
messageContent
.
addElement
(
HttpConstants
.
SPOT
).
setText
(
crossInfoPOExt
.
getCode
());
messageContent
.
addElement
(
HttpConstants
.
SPOT
).
setText
(
crossInfoPOExt
.
getCode
());
messageContent
.
addElement
(
HttpConstants
.
PATTERN
).
setText
(
tempSchemeSendVO
.
getPattern
());
messageContent
.
addElement
(
HttpConstants
.
PATTERN
).
setText
(
tempSchemeSendVO
.
getPattern
());
messageContent
.
addElement
(
HttpConstants
.
CYCLE
).
setText
(
tempSchemeSendVO
.
getCycle
());
messageContent
.
addElement
(
HttpConstants
.
CYCLE
).
setText
(
tempSchemeSendVO
.
getCycle
());
//如果为空赋值神思的默认值
if
(
ObjectUtils
.
isEmpty
(
tempSchemeSendVO
.
getOffset
()))
{
tempSchemeSendVO
.
setOffset
(
"0"
);
}
if
(
ObjectUtils
.
isEmpty
(
tempSchemeSendVO
.
getType
()))
{
tempSchemeSendVO
.
setType
(
"1"
);
}
if
(
ObjectUtils
.
isEmpty
(
tempSchemeSendVO
.
getSplit
()))
{
tempSchemeSendVO
.
setSplit
(
"40,0,0,40,50,50,0,0,0,0,0,0,0,0,0,0"
);
}
messageContent
.
addElement
(
HttpConstants
.
OFFSET
).
setText
(
tempSchemeSendVO
.
getOffset
());
messageContent
.
addElement
(
HttpConstants
.
OFFSET
).
setText
(
tempSchemeSendVO
.
getOffset
());
messageContent
.
addElement
(
HttpConstants
.
TYPE
).
setText
(
tempSchemeSendVO
.
getType
());
messageContent
.
addElement
(
HttpConstants
.
TYPE
).
setText
(
tempSchemeSendVO
.
getType
());
messageContent
.
addElement
(
HttpConstants
.
SPLIT
).
setText
(
tempSchemeSendVO
.
getSplit
());
messageContent
.
addElement
(
HttpConstants
.
SPLIT
).
setText
(
tempSchemeSendVO
.
getSplit
());
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
View file @
33295e5d
package
net
.
wanji
.
utc
.
hisense
.
task
;
package
net
.
wanji
.
utc
.
hisense
.
task
;
import
cn.hutool.core.util.ObjectUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.utils.tool.StringUtils
;
import
net.wanji.common.utils.tool.StringUtils
;
import
net.wanji.databus.dao.entity.CrossLightsPO
;
import
net.wanji.databus.dao.entity.CrossLightsPO
;
...
@@ -113,6 +114,7 @@ public class HisensePhaseCountDownTask {
...
@@ -113,6 +114,7 @@ public class HisensePhaseCountDownTask {
if
(
StringUtils
.
equalsIgnoreCase
(
schemeId
,
String
.
valueOf
(
dirTurnPojo
.
getSchemeNo
())))
{
if
(
StringUtils
.
equalsIgnoreCase
(
schemeId
,
String
.
valueOf
(
dirTurnPojo
.
getSchemeNo
())))
{
if
(!
StringUtils
.
equalsIgnoreCase
(
currenPhaseId
,
String
.
valueOf
(
dirTurnPojo
.
getPhaseNo
())))
{
if
(!
StringUtils
.
equalsIgnoreCase
(
currenPhaseId
,
String
.
valueOf
(
dirTurnPojo
.
getPhaseNo
())))
{
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
dirTurnPojo
.
getDirTurnMap
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
dirTurnPojo
.
getDirTurnMap
();
if
(
ObjectUtil
.
isNotEmpty
(
dirTurnMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
dirEntry
:
dirTurnMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
dirEntry
:
dirTurnMap
.
entrySet
())
{
Integer
dir
=
dirEntry
.
getKey
();
Integer
dir
=
dirEntry
.
getKey
();
Map
<
Integer
,
Integer
>
turnCountDown
=
new
HashMap
<>();
Map
<
Integer
,
Integer
>
turnCountDown
=
new
HashMap
<>();
...
@@ -151,9 +153,12 @@ public class HisensePhaseCountDownTask {
...
@@ -151,9 +153,12 @@ public class HisensePhaseCountDownTask {
}
}
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
}
}
}
}
else
{
}
else
{
Integer
cyclePhaseCountDown
=
lightsStatusVO
.
getCyclePhaseCountDown
();
Integer
cyclePhaseCountDown
=
lightsStatusVO
.
getCyclePhaseCountDown
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
dirTurnPojo
.
getDirTurnMap
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
dirTurnPojo
.
getDirTurnMap
();
if
(
ObjectUtil
.
isNotEmpty
(
dirTurnMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
dirEntry
:
dirTurnMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
dirEntry
:
dirTurnMap
.
entrySet
())
{
Integer
dir
=
dirEntry
.
getKey
();
Integer
dir
=
dirEntry
.
getKey
();
Map
<
Integer
,
Integer
>
turnCountDown
=
new
HashMap
<>();
Map
<
Integer
,
Integer
>
turnCountDown
=
new
HashMap
<>();
...
@@ -187,6 +192,8 @@ public class HisensePhaseCountDownTask {
...
@@ -187,6 +192,8 @@ public class HisensePhaseCountDownTask {
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
}
}
}
}
}
}
}
}
}
}
}
...
@@ -299,7 +306,7 @@ public class HisensePhaseCountDownTask {
...
@@ -299,7 +306,7 @@ public class HisensePhaseCountDownTask {
if
(!
StringUtils
.
equalsIgnoreCase
(
currentPhaseNo
,
String
.
valueOf
(
phaseNo
)))
{
if
(!
StringUtils
.
equalsIgnoreCase
(
currentPhaseNo
,
String
.
valueOf
(
phaseNo
)))
{
// 相位红灯
// 相位红灯
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
phaseDirTurnPojo
.
getDirTurnMap
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
phaseDirTurnPojo
.
getDirTurnMap
();
if
(
!
dirTurnMap
.
isEmpty
(
))
{
if
(
ObjectUtil
.
isNotEmpty
(
dirTurnMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
entry
:
dirTurnMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLightsPO
>>
entry
:
dirTurnMap
.
entrySet
())
{
String
dir
=
String
.
valueOf
(
entry
.
getKey
());
String
dir
=
String
.
valueOf
(
entry
.
getKey
());
Map
<
Integer
,
String
>
turnColor
=
null
;
Map
<
Integer
,
String
>
turnColor
=
null
;
...
@@ -344,8 +351,10 @@ public class HisensePhaseCountDownTask {
...
@@ -344,8 +351,10 @@ public class HisensePhaseCountDownTask {
Integer
yellowTime
=
phaseCountDownDTO
.
getYellowTime
();
Integer
yellowTime
=
phaseCountDownDTO
.
getYellowTime
();
Integer
redTime
=
phaseCountDownDTO
.
getRedTime
();
Integer
redTime
=
phaseCountDownDTO
.
getRedTime
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
phaseDirTurnPojo
.
getDirTurnMap
();
Map
<
Integer
,
List
<
CrossLightsPO
>>
dirTurnMap
=
phaseDirTurnPojo
.
getDirTurnMap
();
if
(
!
dirTurnMap
.
isEmpty
(
))
{
if
(
ObjectUtil
.
isNotEmpty
(
dirTurnMap
))
{
setDirTurnColor
(
cyclePhaseCountDown
,
dirLampGroupMap
,
yellowTime
,
redTime
,
dirTurnMap
,
crossLightsPOS
);
setDirTurnColor
(
cyclePhaseCountDown
,
dirLampGroupMap
,
yellowTime
,
redTime
,
dirTurnMap
,
crossLightsPOS
);
}
else
{
log
.
error
(
"路口:{},dirTurnMap为空,{}"
,
crossId
,
dirTurnMap
);
}
}
}
}
}
}
...
...
wj-common/src/main/java/net/wanji/common/utils/tool/LocalDateTimeUtil.java
View file @
33295e5d
...
@@ -175,6 +175,7 @@ public class LocalDateTimeUtil {
...
@@ -175,6 +175,7 @@ public class LocalDateTimeUtil {
LocalDateTime
localDateTime
=
parseStringToDateTimeTwo
(
nowStageStartTime
,
LocalDateTimeUtil
.
TIMEFORMATTERTILT
);
LocalDateTime
localDateTime
=
parseStringToDateTimeTwo
(
nowStageStartTime
,
LocalDateTimeUtil
.
TIMEFORMATTERTILT
);
String
time
=
nowStageStartTime
.
isEmpty
()
?
"0"
:
Long
.
toString
(
LocalDateTimeUtil
.
betweenTwoTime
(
localDateTime
,
LocalDateTime
.
now
(),
ChronoUnit
.
SECONDS
));
String
time
=
nowStageStartTime
.
isEmpty
()
?
"0"
:
Long
.
toString
(
LocalDateTimeUtil
.
betweenTwoTime
(
localDateTime
,
LocalDateTime
.
now
(),
ChronoUnit
.
SECONDS
));
System
.
out
.
println
(
time
);
System
.
out
.
println
(
time
);
System
.
out
.
println
(
new
Date
().
getTime
());
}
}
/**
/**
...
...
wj-databus/src/main/java/net/wanji/databus/vo/TempSchemeSendVO.java
View file @
33295e5d
...
@@ -32,8 +32,7 @@ public class TempSchemeSendVO {
...
@@ -32,8 +32,7 @@ public class TempSchemeSendVO {
@NotBlank
(
message
=
"offset不能为空"
)
@NotBlank
(
message
=
"offset不能为空"
)
private
String
offset
;
private
String
offset
;
@ApiModelProperty
(
value
=
"优化模式"
,
notes
=
"目前支持 Type=1(预案模式,按时间调整),Type=15(瓶颈模式,\n"
+
@ApiModelProperty
(
value
=
"优化模式"
,
notes
=
"目前支持 Type=1(预案模式,按时间调整),Type=1 时为协调模式,Type=15(瓶颈模式,按比例调整)"
)
"按比例调整)"
)
@NotBlank
(
message
=
"type不能为空"
)
@NotBlank
(
message
=
"type不能为空"
)
private
String
type
;
private
String
type
;
...
...
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