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
67ba5b67
Commit
67ba5b67
authored
Mar 08, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
821235e6
a3877f58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
AddOrUpdateSceneDTO.java
.../java/net/wanji/opt/dto/strategy/AddOrUpdateSceneDTO.java
+5
-0
DiagnoServiceImpl.java
...in/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
+2
-1
IdeaServiceImpl.java
.../net/wanji/opt/service/strategy/impl/IdeaServiceImpl.java
+9
-8
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/dto/strategy/AddOrUpdateSceneDTO.java
View file @
67ba5b67
...
...
@@ -4,8 +4,10 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Range
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
java.util.List
;
...
...
@@ -32,6 +34,7 @@ public class AddOrUpdateSceneDTO {
private
Integer
secneTarget
;
@ApiModelProperty
(
value
=
"应用策略"
,
required
=
true
,
notes
=
""
)
@Valid
@NotEmpty
(
message
=
"策略不可为空"
)
private
List
<
StrategyListElement
>
strategyList
;
@NoArgsConstructor
...
...
@@ -43,8 +46,10 @@ public class AddOrUpdateSceneDTO {
private
String
strategyName
;
@ApiModelProperty
(
value
=
"优先级"
,
required
=
true
,
notes
=
""
)
@NotNull
(
message
=
"优先级不可为空"
)
@Range
(
min
=
1
,
max
=
99
,
message
=
"优先级为1至99数字"
)
private
Integer
priority
;
@ApiModelProperty
(
value
=
"优化方法"
,
required
=
true
,
notes
=
""
)
@NotEmpty
(
message
=
"方法不可为空"
)
private
List
<
IdeaListElement
>
ideaList
;
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
View file @
67ba5b67
...
...
@@ -78,7 +78,8 @@ public class DiagnoServiceImpl implements DiagnoService {
SceneService
sceneService
,
SceneMapper
sceneMapper
,
CrossDirInfoMapper
crossDirInfoMapper
,
RidInfoMapper
ridInfoMapper
,
CrossSchemeOptLogMapper
crossSchemeOptLogMapper
,
CrossSchemeMapper
crossSchemeMapper
,
CrossPhaseMapper
crossPhaseMapper
,
FeignProxyService
feignProxyService
,
CrossDataHistMapper
crossDataHistMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
)
{
FeignProxyService
feignProxyService
,
CrossDataHistMapper
crossDataHistMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
)
{
this
.
crossInfoMapper
=
crossInfoMapper
;
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
this
.
sceneService
=
sceneService
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/strategy/impl/IdeaServiceImpl.java
View file @
67ba5b67
...
...
@@ -36,23 +36,24 @@ public class IdeaServiceImpl implements IdeaService {
if
(
ObjectUtil
.
isEmpty
(
id
)
||
id
==
0
)
{
// 不传ID为新增
IdeaPO
ideaPO
=
new
IdeaPO
();
ideaPO
.
setIdeaCode
(
addOrUpdateIdeaDTO
.
getIdeaCode
());
ideaPO
.
setIdeaName
(
addOrUpdateIdeaDTO
.
getIdeaName
());
ideaPO
.
setIdeaTarget
(
addOrUpdateIdeaDTO
.
getIdeaTarget
());
ideaPO
.
setIdeaDetail
(
addOrUpdateIdeaDTO
.
getIdeaDetail
());
fillData
(
addOrUpdateIdeaDTO
,
ideaPO
);
ideaMapper
.
insertOne
(
ideaPO
);
}
else
{
// 传ID为修改
IdeaPO
ideaPO
=
new
IdeaPO
();
ideaPO
.
setId
(
id
);
ideaPO
.
setIdeaCode
(
addOrUpdateIdeaDTO
.
getIdeaCode
());
ideaPO
.
setIdeaName
(
addOrUpdateIdeaDTO
.
getIdeaName
());
ideaPO
.
setIdeaTarget
(
addOrUpdateIdeaDTO
.
getIdeaTarget
());
ideaPO
.
setIdeaDetail
(
addOrUpdateIdeaDTO
.
getIdeaDetail
());
fillData
(
addOrUpdateIdeaDTO
,
ideaPO
);
ideaMapper
.
updateOne
(
ideaPO
);
}
}
private
void
fillData
(
AddOrUpdateIdeaDTO
addOrUpdateIdeaDTO
,
IdeaPO
ideaPO
)
{
ideaPO
.
setIdeaCode
(
addOrUpdateIdeaDTO
.
getIdeaCode
());
ideaPO
.
setIdeaName
(
addOrUpdateIdeaDTO
.
getIdeaName
());
ideaPO
.
setIdeaTarget
(
addOrUpdateIdeaDTO
.
getIdeaTarget
());
ideaPO
.
setIdeaDetail
(
addOrUpdateIdeaDTO
.
getIdeaDetail
());
}
@Override
public
void
deleteIdea
(
IntegerIdsDTO
integerIdsDTO
)
{
List
<
Integer
>
ids
=
integerIdsDTO
.
getIds
();
...
...
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