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
e6e80b11
Commit
e6e80b11
authored
Nov 22, 2022
by
wuxiaokai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
控制指令接口-时间表下发
parent
cb25f5d8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
ControlCommandController.java
...va/net/wanji/utc/controller/ControlCommandController.java
+22
-1
ControlCommandService.java
...ain/java/net/wanji/utc/service/ControlCommandService.java
+1
-1
HKControlCommandServiceImpl.java
...t/wanji/utc/service/impl/HKControlCommandServiceImpl.java
+7
-7
No files found.
signal-utc-service/src/main/java/net/wanji/utc/controller/ControlCommandController.java
View file @
e6e80b11
...
@@ -10,6 +10,7 @@ import net.wanji.utc.mapper.CrossInfoMapper;
...
@@ -10,6 +10,7 @@ import net.wanji.utc.mapper.CrossInfoMapper;
import
net.wanji.utc.po.CrossInfoPO
;
import
net.wanji.utc.po.CrossInfoPO
;
import
net.wanji.utc.service.ControlCommandService
;
import
net.wanji.utc.service.ControlCommandService
;
import
net.wanji.utc.vo.plansend.PlanSendVO
;
import
net.wanji.utc.vo.plansend.PlanSendVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -35,10 +36,11 @@ public class ControlCommandController {
...
@@ -35,10 +36,11 @@ public class ControlCommandController {
@Resource
@Resource
private
CrossInfoMapper
crossInfoMapper
;
private
CrossInfoMapper
crossInfoMapper
;
@
Resource
@
Autowired
private
ControlCommandService
hkControlCommandService
;
private
ControlCommandService
hkControlCommandService
;
/**
/**
*
*/
*/
@ApiOperation
(
value
=
"方案下发-基础方案下发"
,
notes
=
"方案下发-基础方案下发"
)
@ApiOperation
(
value
=
"方案下发-基础方案下发"
,
notes
=
"方案下发-基础方案下发"
)
@PostMapping
(
"/schemeSend"
)
@PostMapping
(
"/schemeSend"
)
...
@@ -168,6 +170,25 @@ public class ControlCommandController {
...
@@ -168,6 +170,25 @@ public class ControlCommandController {
}
}
}
}
/**
* 恢复时间表
*
* @param signalId 信号id
* @return {@link Result}<{@link T}>
*/
@ApiOperation
(
value
=
"恢复时间表-恢复路口时间表执行"
,
notes
=
"恢复时间表-恢复路口时间表执行"
)
@PostMapping
(
"/scheduleSend"
)
public
<
T
>
Result
<
T
>
scheduleSend
(
@RequestParam
String
signalId
)
{
if
(
mock
)
return
Result
.
success
();
Integer
manufacturerId
=
check
(
signalId
);
if
(
manufacturerId
.
equals
(
BasicEnum
.
ManufacturerEnum
.
HK
.
getCode
()))
{
return
hkControlCommandService
.
scheduleSend
(
signalId
,
null
,
null
,
null
);
}
else
{
// todo else
return
null
;
}
}
private
Integer
check
(
String
signalId
)
{
private
Integer
check
(
String
signalId
)
{
CrossInfoPO
crossInfoPO
=
crossInfoMapper
.
selectByCode
(
signalId
);
CrossInfoPO
crossInfoPO
=
crossInfoMapper
.
selectByCode
(
signalId
);
if
(
crossInfoPO
==
null
)
{
if
(
crossInfoPO
==
null
)
{
...
...
signal-utc-service/src/main/java/net/wanji/utc/service/ControlCommandService.java
View file @
e6e80b11
...
@@ -25,7 +25,7 @@ public interface ControlCommandService {
...
@@ -25,7 +25,7 @@ public interface ControlCommandService {
/**
/**
* 时间表下发
* 时间表下发
*/
*/
<
T
>
Result
<
T
>
scheduleSend
();
<
T
>
Result
<
T
>
scheduleSend
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
);
/**
/**
* 锁定控制
* 锁定控制
...
...
signal-utc-service/src/main/java/net/wanji/utc/service/impl/HKControlCommandServiceImpl.java
View file @
e6e80b11
...
@@ -62,8 +62,8 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
...
@@ -62,8 +62,8 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
}
}
@Override
@Override
public
<
T
>
Result
<
T
>
scheduleSend
()
{
public
<
T
>
Result
<
T
>
scheduleSend
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
return
null
;
return
controlSignal
(
signalId
,
NORMAL_RUNNING_CONTROL
)
;
}
}
@Override
@Override
...
@@ -74,25 +74,25 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
...
@@ -74,25 +74,25 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
@Override
@Override
public
<
T
>
Result
<
T
>
stepControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
,
Integer
stepNum
)
{
public
<
T
>
Result
<
T
>
stepControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
,
Integer
stepNum
)
{
if
(
command
.
equals
(
TRUE
))
return
updateManualStep
(
signalId
,
STEP_CONTROL
,
stepNum
);
if
(
command
.
equals
(
TRUE
))
return
updateManualStep
(
signalId
,
STEP_CONTROL
,
stepNum
);
else
return
updateManu
al
(
signalId
,
CANCEL_STEP_CONTROL
);
else
return
controlSign
al
(
signalId
,
CANCEL_STEP_CONTROL
);
}
}
@Override
@Override
public
<
T
>
Result
<
T
>
allRedControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
public
<
T
>
Result
<
T
>
allRedControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
ALL_RED_CONTROL
:
NORMAL_RUNNING_CONTROL
;
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
ALL_RED_CONTROL
:
NORMAL_RUNNING_CONTROL
;
return
updateManu
al
(
signalId
,
runningMode
);
return
controlSign
al
(
signalId
,
runningMode
);
}
}
@Override
@Override
public
<
T
>
Result
<
T
>
yellowLightControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
public
<
T
>
Result
<
T
>
yellowLightControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
YELLOW_LIGHT_CONTROL
:
NORMAL_RUNNING_CONTROL
;
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
YELLOW_LIGHT_CONTROL
:
NORMAL_RUNNING_CONTROL
;
return
updateManu
al
(
signalId
,
runningMode
);
return
controlSign
al
(
signalId
,
runningMode
);
}
}
@Override
@Override
public
<
T
>
Result
<
T
>
closeLightControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
public
<
T
>
Result
<
T
>
closeLightControl
(
String
signalId
,
String
sourceType
,
String
signalType
,
Integer
command
)
{
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
CLOSE_LIGHT_CONTROL
:
NORMAL_RUNNING_CONTROL
;
Integer
runningMode
=
command
.
equals
(
TRUE
)
?
CLOSE_LIGHT_CONTROL
:
NORMAL_RUNNING_CONTROL
;
return
updateManu
al
(
signalId
,
runningMode
);
return
controlSign
al
(
signalId
,
runningMode
);
}
}
@Override
@Override
...
@@ -148,7 +148,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
...
@@ -148,7 +148,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
* @param signalId 信号机编号
* @param signalId 信号机编号
* @param runningMode 0-多时段控制模式 1-关灯、2-黄闪、3-全红、11-取消步进控制、12-灯态锁定、13-灯态解锁
* @param runningMode 0-多时段控制模式 1-关灯、2-黄闪、3-全红、11-取消步进控制、12-灯态锁定、13-灯态解锁
*/
*/
private
<
T
>
Result
<
T
>
updateManu
al
(
String
signalId
,
Integer
runningMode
)
{
private
<
T
>
Result
<
T
>
controlSign
al
(
String
signalId
,
Integer
runningMode
)
{
//执行恢复时间表方案命令
//执行恢复时间表方案命令
if
(
NORMAL_RUNNING_CONTROL
.
equals
(
runningMode
)
||
CANCEL_STEP_CONTROL
.
equals
(
runningMode
))
{
if
(
NORMAL_RUNNING_CONTROL
.
equals
(
runningMode
)
||
CANCEL_STEP_CONTROL
.
equals
(
runningMode
))
{
//根据实时灯态获取当前运行模式
//根据实时灯态获取当前运行模式
...
...
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