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
jinan
traffic-signal-platform
Commits
795a3da3
Commit
795a3da3
authored
Mar 15, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略推荐优化
parent
ae1c02ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
2 deletions
+111
-2
SignalCommandOptController.java
.../controller/signalcontrol/SignalCommandOptController.java
+58
-1
FeignProxyService.java
...et/wanji/opt/service/signalcontrol/FeignProxyService.java
+18
-0
FeignProxyServiceImpl.java
...opt/service/signalcontrol/impl/FeignProxyServiceImpl.java
+34
-0
ControlCommandVO.java
.../src/main/java/net/wanji/databus/vo/ControlCommandVO.java
+1
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/signalcontrol/SignalCommandOptController.java
View file @
795a3da3
...
@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiResponses;
...
@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiResponses;
import
net.wanji.common.annotation.aspect.AspectLog
;
import
net.wanji.common.annotation.aspect.AspectLog
;
import
net.wanji.common.enums.BaseEnum
;
import
net.wanji.common.enums.BaseEnum
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.databus.bo.CrossIdBO
;
import
net.wanji.databus.vo.ControlCommandVO
;
import
net.wanji.databus.vo.SchemeOptSendVO
;
import
net.wanji.databus.vo.SchemeOptSendVO
;
import
net.wanji.opt.service.signalcontrol.FeignProxyService
;
import
net.wanji.opt.service.signalcontrol.FeignProxyService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -23,7 +25,7 @@ import javax.ws.rs.core.MediaType;
...
@@ -23,7 +25,7 @@ import javax.ws.rs.core.MediaType;
* @author duanruiming
* @author duanruiming
* @date 2023/03/01 20:44
* @date 2023/03/01 20:44
*/
*/
@Api
(
value
=
"SignalCommandOptController"
,
description
=
"信号
优化
"
)
@Api
(
value
=
"SignalCommandOptController"
,
description
=
"信号
机控制
"
)
@RequestMapping
(
"/signalControl"
)
@RequestMapping
(
"/signalControl"
)
@RestController
@RestController
public
class
SignalCommandOptController
{
public
class
SignalCommandOptController
{
...
@@ -53,4 +55,59 @@ public class SignalCommandOptController {
...
@@ -53,4 +55,59 @@ public class SignalCommandOptController {
return
jsonViewObject
;
return
jsonViewObject
;
}
}
@AspectLog
(
description
=
"全红控制"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"全红控制"
,
notes
=
"全红控制"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/allRedControl"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
)})
public
JsonViewObject
allRedControl
(
@RequestBody
ControlCommandVO
vo
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
feignProxyService
.
allRedControl
(
vo
);
return
jsonViewObject
;
}
@AspectLog
(
description
=
"黄闪控制"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"黄闪控制"
,
notes
=
"黄闪控制"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/yellowLightControl"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
)})
public
JsonViewObject
yellowLightControl
(
@RequestBody
ControlCommandVO
vo
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
feignProxyService
.
yellowLightControl
(
vo
);
return
jsonViewObject
;
}
@AspectLog
(
description
=
"步进控制"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"步进控制"
,
notes
=
"步进控制"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/stepControl"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
)})
public
JsonViewObject
stepControl
(
String
crossId
,
Integer
command
,
Integer
stepNum
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
feignProxyService
.
stepControl
(
crossId
,
command
,
stepNum
);
return
jsonViewObject
;
}
@AspectLog
(
description
=
"相位锁定"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"相位锁定"
,
notes
=
"相位锁定"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/lockControl"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
)})
public
JsonViewObject
lockControl
(
@RequestBody
ControlCommandVO
vo
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
feignProxyService
.
lockControl
(
vo
);
return
jsonViewObject
;
}
@AspectLog
(
description
=
"恢复时间表"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"恢复时间表"
,
notes
=
"恢复时间表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/recoverSchedule"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
)})
public
JsonViewObject
recoverSchedule
(
@RequestBody
CrossIdBO
crossIdBO
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
feignProxyService
.
recoverSchedule
(
crossIdBO
);
return
jsonViewObject
;
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/signalcontrol/FeignProxyService.java
View file @
795a3da3
package
net
.
wanji
.
opt
.
service
.
signalcontrol
;
package
net
.
wanji
.
opt
.
service
.
signalcontrol
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.databus.bo.CrossIdBO
;
import
net.wanji.databus.vo.ControlCommandVO
;
import
net.wanji.databus.vo.SchemeOptSendVO
;
import
net.wanji.databus.vo.SchemeOptSendVO
;
/**
/**
...
@@ -10,4 +12,20 @@ import net.wanji.databus.vo.SchemeOptSendVO;
...
@@ -10,4 +12,20 @@ import net.wanji.databus.vo.SchemeOptSendVO;
public
interface
FeignProxyService
{
public
interface
FeignProxyService
{
JsonViewObject
schemeOptSend
(
SchemeOptSendVO
schemeOptSendVO
)
throws
Exception
;
JsonViewObject
schemeOptSend
(
SchemeOptSendVO
schemeOptSendVO
)
throws
Exception
;
JsonViewObject
schemeOptRestore
(
String
crossId
)
throws
Exception
;
JsonViewObject
schemeOptRestore
(
String
crossId
)
throws
Exception
;
/** 增加路口红闪,黄闪,步进,相位锁定服务 20250315 /
*
* @param vo
* @return
* @throws Exception
*/
JsonViewObject
allRedControl
(
ControlCommandVO
vo
)
throws
Exception
;
JsonViewObject
yellowLightControl
(
ControlCommandVO
vo
)
throws
Exception
;
JsonViewObject
stepControl
(
String
crossId
,
Integer
command
,
Integer
stepNum
)
throws
Exception
;
JsonViewObject
lockControl
(
ControlCommandVO
vo
)
throws
Exception
;
JsonViewObject
recoverSchedule
(
CrossIdBO
crossIdBO
)
throws
Exception
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/signalcontrol/impl/FeignProxyServiceImpl.java
View file @
795a3da3
...
@@ -4,7 +4,10 @@ import lombok.RequiredArgsConstructor;
...
@@ -4,7 +4,10 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.framework.exception.FeignServiceException
;
import
net.wanji.common.framework.exception.FeignServiceException
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.databus.bo.CrossIdBO
;
import
net.wanji.databus.entity.develop.servicedevelop.develop.StatusCodeEnum
;
import
net.wanji.databus.entity.develop.servicedevelop.develop.StatusCodeEnum
;
import
net.wanji.databus.vo.ControlCommandVO
;
import
net.wanji.databus.vo.LockControlVO
;
import
net.wanji.databus.vo.SchemeSendVO
;
import
net.wanji.databus.vo.SchemeSendVO
;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.opt.cache.CrossDirTurnPhaseCache
;
import
net.wanji.opt.cache.CrossDirTurnPhaseCache
;
...
@@ -127,4 +130,35 @@ public class FeignProxyServiceImpl implements FeignProxyService {
...
@@ -127,4 +130,35 @@ public class FeignProxyServiceImpl implements FeignProxyService {
}
}
return
crossSchemeOptLogPOS
;
return
crossSchemeOptLogPOS
;
}
}
@Override
public
JsonViewObject
allRedControl
(
ControlCommandVO
vo
)
throws
Exception
{
return
utcFeignClients
.
allRedControl
(
vo
);
}
@Override
public
JsonViewObject
yellowLightControl
(
ControlCommandVO
vo
)
throws
Exception
{
return
utcFeignClients
.
yellowLightControl
(
vo
);
}
@Override
public
JsonViewObject
stepControl
(
String
crossId
,
Integer
command
,
Integer
stepNum
)
throws
Exception
{
return
utcFeignClients
.
stepControl
(
crossId
,
command
,
stepNum
);
}
@Override
public
JsonViewObject
lockControl
(
ControlCommandVO
vo
)
throws
Exception
{
LockControlVO
lockControlVO
=
new
LockControlVO
();
lockControlVO
.
setCrossCode
(
vo
.
getCrossCode
());
lockControlVO
.
setCommand
(
vo
.
getCommand
());
lockControlVO
.
setDuration
(
vo
.
getDuration
());
lockControlVO
.
setPhaseList
(
vo
.
getPhaseList
());
return
utcFeignClients
.
lockControl
(
lockControlVO
);
}
@Override
public
JsonViewObject
recoverSchedule
(
CrossIdBO
crossIdBO
)
throws
Exception
{
return
utcFeignClients
.
recoverSchedule
(
crossIdBO
.
getCrossId
());
}
}
}
wj-databus/src/main/java/net/wanji/databus/vo/ControlCommandVO.java
View file @
795a3da3
...
@@ -28,7 +28,7 @@ public class ControlCommandVO {
...
@@ -28,7 +28,7 @@ public class ControlCommandVO {
@Min
(
value
=
0
,
message
=
"控制类型:1是;0否"
)
@Min
(
value
=
0
,
message
=
"控制类型:1是;0否"
)
private
Integer
command
;
private
Integer
command
;
@ApiModelProperty
(
value
=
"1关灯 2黄闪 3全红"
)
@ApiModelProperty
(
value
=
"1关灯 2黄闪 3全红
锁定步进时,不需要发送
"
)
private
Integer
controlType
;
private
Integer
controlType
;
@ApiModelProperty
(
value
=
"持续时间"
)
@ApiModelProperty
(
value
=
"持续时间"
)
...
...
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