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
2366e1f4
Commit
2366e1f4
authored
Feb 15, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略查询修改数据结构;增加策略锁定接口
parent
e4681840
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
4 deletions
+61
-4
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+13
-0
StrategyControlService.java
...t/wanji/opt/synthesis/service/StrategyControlService.java
+3
-0
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+18
-3
StrategyLockSendVO.java
...ce/src/main/java/net/wanji/opt/vo/StrategyLockSendVO.java
+19
-0
StrategyNameCrossVO.java
...e/src/main/java/net/wanji/opt/vo/StrategyNameCrossVO.java
+8
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
2366e1f4
...
@@ -9,6 +9,7 @@ import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
...
@@ -9,6 +9,7 @@ import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
import
net.wanji.opt.synthesis.pojo.vo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.vo.StrategyLockSendVO
;
import
net.wanji.opt.vo.StrategyNameCrossVO
;
import
net.wanji.opt.vo.StrategyNameCrossVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -153,6 +154,18 @@ public class StrategyControlController {
...
@@ -153,6 +154,18 @@ public class StrategyControlController {
return
strategyControlService
.
strategyFactoryList
(
vo
);
return
strategyControlService
.
strategyFactoryList
(
vo
);
}
}
@ApiOperation
(
value
=
"策略管理-路口详情-策略锁定"
,
notes
=
"策略管理-路口详情-策略锁定"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/strategyLockSend"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyNameCrossVO
.
class
),
})
public
JsonViewObject
strategyLockCrossInfo
(
@RequestBody
StrategyLockSendVO
strategyLockSendVO
)
throws
Exception
{
return
strategyControlService
.
strategyLockSend
(
strategyLockSendVO
);
}
@ApiOperation
(
value
=
"策略管理-路口详情-优化策略查询"
,
notes
=
"策略管理-路口详情-优化策略查询"
,
@ApiOperation
(
value
=
"策略管理-路口详情-优化策略查询"
,
notes
=
"策略管理-路口详情-优化策略查询"
,
response
=
JsonViewObject
.
class
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/StrategyControlService.java
View file @
2366e1f4
...
@@ -6,6 +6,7 @@ import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
...
@@ -6,6 +6,7 @@ import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
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.pojo.vo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO
;
import
net.wanji.opt.synthesis.pojo.vo.StrategyFactoryQueryVO
;
import
net.wanji.opt.vo.StrategyLockSendVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -39,4 +40,6 @@ public interface StrategyControlService {
...
@@ -39,4 +40,6 @@ public interface StrategyControlService {
JsonViewObject
strategyFactoryDel
(
List
<
Integer
>
ids
)
throws
Exception
;
JsonViewObject
strategyFactoryDel
(
List
<
Integer
>
ids
)
throws
Exception
;
JsonViewObject
strategyNameCrossInfo
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyNameCrossInfo
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyLockSend
(
StrategyLockSendVO
strategyLockSendVO
)
throws
Exception
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
2366e1f4
...
@@ -28,6 +28,7 @@ import net.wanji.opt.synthesis.pojo.*;
...
@@ -28,6 +28,7 @@ import net.wanji.opt.synthesis.pojo.*;
import
net.wanji.opt.synthesis.pojo.vo.*
;
import
net.wanji.opt.synthesis.pojo.vo.*
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.vo.StrategyLockSendVO
;
import
net.wanji.opt.vo.StrategyNameCrossVO
;
import
net.wanji.opt.vo.StrategyNameCrossVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.NotNull
;
...
@@ -1182,21 +1183,27 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -1182,21 +1183,27 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
List
<
StrategyFactoryEntity
>
factoryEntities
=
strategyFactoryMapper
.
selectList
(
factoryQuery
);
List
<
StrategyFactoryEntity
>
factoryEntities
=
strategyFactoryMapper
.
selectList
(
factoryQuery
);
String
currentName
=
""
;
String
currentName
=
""
;
List
<
String
>
strategyNames
=
new
ArrayList
<>();
String
currentNo
=
""
;
List
<
StrategyNameCrossVO
.
Detail
>
details
=
new
ArrayList
<>();
for
(
StrategyFactoryEntity
factoryEntity
:
factoryEntities
)
{
for
(
StrategyFactoryEntity
factoryEntity
:
factoryEntities
)
{
String
company
=
factoryEntity
.
getCompany
();
String
company
=
factoryEntity
.
getCompany
();
String
strategyName
=
factoryEntity
.
getStrategyName
();
String
strategyName
=
factoryEntity
.
getStrategyName
();
String
method
=
factoryEntity
.
getMethod
();
String
method
=
factoryEntity
.
getMethod
();
String
strategyNo
=
factoryEntity
.
getStrategyNo
();
String
strategyNo
=
factoryEntity
.
getStrategyNo
();
String
name
=
String
.
join
(
"-"
,
company
,
method
,
strategyName
);
String
name
=
String
.
join
(
"-"
,
company
,
method
,
strategyName
);
strategyNames
.
add
(
name
);
StrategyNameCrossVO
.
Detail
detail
=
new
StrategyNameCrossVO
.
Detail
();
detail
.
setStrategyNo
(
strategyNo
);
detail
.
setStrategyName
(
name
);
details
.
add
(
detail
);
if
(
StringUtils
.
equals
(
strategyNo
,
currentStrategyNo
))
{
if
(
StringUtils
.
equals
(
strategyNo
,
currentStrategyNo
))
{
currentName
=
name
;
currentName
=
name
;
currentNo
=
currentStrategyNo
;
}
}
}
}
if
(
StringUtils
.
isNotBlank
(
currentName
))
{
if
(
StringUtils
.
isNotBlank
(
currentName
))
{
strategyNameCrossVO
.
setCurrentName
(
currentName
);
strategyNameCrossVO
.
setCurrentName
(
currentName
);
strategyNameCrossVO
.
setStrategyNo
(
currentNo
);
}
else
{
}
else
{
if
(!
CollectionUtils
.
isEmpty
(
factoryEntities
))
{
if
(!
CollectionUtils
.
isEmpty
(
factoryEntities
))
{
StrategyFactoryEntity
strategyFactoryEntity
=
factoryEntities
.
get
(
0
);
StrategyFactoryEntity
strategyFactoryEntity
=
factoryEntities
.
get
(
0
);
...
@@ -1205,9 +1212,10 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -1205,9 +1212,10 @@ public class StrategyControlServiceImpl implements StrategyControlService {
String
method
=
strategyFactoryEntity
.
getMethod
();
String
method
=
strategyFactoryEntity
.
getMethod
();
String
name
=
String
.
join
(
"-"
,
company
,
method
,
strategyName
);
String
name
=
String
.
join
(
"-"
,
company
,
method
,
strategyName
);
strategyNameCrossVO
.
setCurrentName
(
name
);
strategyNameCrossVO
.
setCurrentName
(
name
);
strategyNameCrossVO
.
setStrategyNo
(
strategyFactoryEntity
.
getStrategyNo
());
}
}
}
}
strategyNameCrossVO
.
set
StrategyNames
(
strategyName
s
);
strategyNameCrossVO
.
set
Details
(
detail
s
);
}
}
return
jsonViewObject
.
success
(
strategyNameCrossVO
);
return
jsonViewObject
.
success
(
strategyNameCrossVO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -1215,4 +1223,11 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -1215,4 +1223,11 @@ public class StrategyControlServiceImpl implements StrategyControlService {
return
jsonViewObject
.
fail
(
"策略管理-路口详情-优化策略查询失败"
);
return
jsonViewObject
.
fail
(
"策略管理-路口详情-优化策略查询失败"
);
}
}
}
}
@Override
public
JsonViewObject
strategyLockSend
(
StrategyLockSendVO
strategyLockSendVO
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
log
.
error
(
"收到请求参数:{}"
,
strategyLockSendVO
);
return
jsonViewObject
.
success
(
"策略锁定成功"
);
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/StrategyLockSendVO.java
0 → 100644
View file @
2366e1f4
package
net
.
wanji
.
opt
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2025/02/15 14:51
* @description 策略管理-地图路口详情-策略锁定实体
*/
@Data
@ApiModel
(
value
=
"StrategyLockSendVO"
,
description
=
"策略管理-地图路口详情-策略锁定实体"
)
public
class
StrategyLockSendVO
{
@ApiModelProperty
(
name
=
"路口ID"
,
notes
=
""
)
private
String
crossId
;
@ApiModelProperty
(
name
=
"路口ID"
,
notes
=
""
)
private
Double
lockTime
;
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/StrategyNameCrossVO.java
View file @
2366e1f4
...
@@ -14,5 +14,12 @@ import java.util.List;
...
@@ -14,5 +14,12 @@ import java.util.List;
@ApiModel
(
value
=
"StrategyNameCrossVO"
,
description
=
"策略管理-路口详情-优化策略返回实体"
)
@ApiModel
(
value
=
"StrategyNameCrossVO"
,
description
=
"策略管理-路口详情-优化策略返回实体"
)
public
class
StrategyNameCrossVO
{
public
class
StrategyNameCrossVO
{
private
String
currentName
;
private
String
currentName
;
private
List
<
String
>
strategyNames
;
private
String
strategyNo
;
private
List
<
Detail
>
details
;
@Data
public
static
class
Detail
{
private
String
strategyName
;
private
String
strategyNo
;
}
}
}
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