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
32351e1a
Commit
32351e1a
authored
Jan 17, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略库优化;
parent
4ee86053
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+14
-2
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+24
-19
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
32351e1a
...
...
@@ -141,14 +141,26 @@ public class StrategyControlController {
@ApiOperation
(
value
=
"策略库分页查询列表"
,
notes
=
"策略库分页查询列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/strategyFactoryList"
)
@PostMapping
(
value
=
"/strategyFactoryPageList"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyFactoryEntity
.
class
),
})
public
JsonViewObject
strategyFactoryList
(
@RequestBody
StrategyFactoryQueryVO
vo
)
throws
Exception
{
public
JsonViewObject
strategyFactory
Page
List
(
@RequestBody
StrategyFactoryQueryVO
vo
)
throws
Exception
{
return
strategyControlService
.
strategyFactoryList
(
vo
);
}
@ApiOperation
(
value
=
"策略库查询列表"
,
notes
=
"策略库分页查询列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@GetMapping
(
value
=
"/strategyFactoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyFactoryEntity
.
class
),
})
public
JsonViewObject
strategyFactoryList
()
throws
Exception
{
return
strategyControlService
.
strategyFactoryList
(
null
);
}
@ApiOperation
(
value
=
"策略管理计划保存"
,
notes
=
"策略管理计划列表查询"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
32351e1a
...
...
@@ -186,7 +186,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
// LocalDateTime localDateTime = Objects.equals(0, groupType) ? DateUtil.getPlusHour(-1) : DateUtil.getMidNight();
LocalDateTime
localDateTime
=
null
;
switch
(
groupType
)
{
switch
(
groupType
)
{
case
0
:
localDateTime
=
DateUtil
.
getPlusHour
(-
1
);
break
;
...
...
@@ -868,26 +868,31 @@ public class StrategyControlServiceImpl implements StrategyControlService {
@Override
public
JsonViewObject
strategyFactoryList
(
StrategyFactoryQueryVO
vo
)
throws
Exception
{
Page
<
StrategyFactoryEntity
>
page
=
new
Page
<>(
vo
.
getCurrentPage
(),
vo
.
getPageSize
()
);
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
(
);
LambdaQueryWrapper
<
StrategyFactoryEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
Objects
.
nonNull
(
vo
.
getType
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getType
,
vo
.
getType
());
}
if
(
Objects
.
nonNull
(
vo
.
getScene
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getScene
,
vo
.
getScene
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getStrategyName
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getStrategyName
,
vo
.
getStrategyName
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getStrategyNo
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getStrategyNo
,
vo
.
getStrategyNo
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getCompany
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getCompany
,
vo
.
getCompany
());
if
(
Objects
.
isNull
(
vo
))
{
List
<
StrategyFactoryEntity
>
result
=
strategyFactoryMapper
.
selectList
(
queryWrapper
);
jsonViewObject
.
success
(
result
);
}
else
{
Page
<
StrategyFactoryEntity
>
page
=
new
Page
<>(
vo
.
getCurrentPage
(),
vo
.
getPageSize
());
if
(
Objects
.
nonNull
(
vo
.
getType
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getType
,
vo
.
getType
());
}
if
(
Objects
.
nonNull
(
vo
.
getScene
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getScene
,
vo
.
getScene
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getStrategyName
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getStrategyName
,
vo
.
getStrategyName
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getStrategyNo
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getStrategyNo
,
vo
.
getStrategyNo
());
}
if
(
StringUtils
.
isNotBlank
(
vo
.
getCompany
()))
{
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getCompany
,
vo
.
getCompany
());
}
Page
<
StrategyFactoryEntity
>
result
=
strategyFactoryMapper
.
selectPage
(
page
,
queryWrapper
);
jsonViewObject
.
success
(
result
);
}
Page
<
StrategyFactoryEntity
>
strategyFactoryEntityPage
=
strategyFactoryMapper
.
selectPage
(
page
,
queryWrapper
);
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
jsonViewObject
.
success
(
strategyFactoryEntityPage
);
return
jsonViewObject
;
}
...
...
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