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
f6bffb09
Commit
f6bffb09
authored
Mar 07, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 策略管理,参数校验
parent
da754aed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
AddOrUpdateSceneDTO.java
.../java/net/wanji/opt/dto/strategy/AddOrUpdateSceneDTO.java
+4
-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 @
f6bffb09
...
@@ -6,6 +6,7 @@ import lombok.Data;
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Pattern
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,6 +33,7 @@ public class AddOrUpdateSceneDTO {
...
@@ -32,6 +33,7 @@ public class AddOrUpdateSceneDTO {
private
Integer
secneTarget
;
private
Integer
secneTarget
;
@ApiModelProperty
(
value
=
"应用策略"
,
required
=
true
,
notes
=
""
)
@ApiModelProperty
(
value
=
"应用策略"
,
required
=
true
,
notes
=
""
)
@Valid
@Valid
@NotEmpty
(
message
=
"策略不可为空"
)
private
List
<
StrategyListElement
>
strategyList
;
private
List
<
StrategyListElement
>
strategyList
;
@NoArgsConstructor
@NoArgsConstructor
...
@@ -43,8 +45,10 @@ public class AddOrUpdateSceneDTO {
...
@@ -43,8 +45,10 @@ public class AddOrUpdateSceneDTO {
private
String
strategyName
;
private
String
strategyName
;
@ApiModelProperty
(
value
=
"优先级"
,
required
=
true
,
notes
=
""
)
@ApiModelProperty
(
value
=
"优先级"
,
required
=
true
,
notes
=
""
)
@NotNull
(
message
=
"优先级不可为空"
)
@NotNull
(
message
=
"优先级不可为空"
)
@Pattern
(
regexp
=
"^[0-9]{1,2}$"
,
message
=
"优先级为整数,且最多两位"
)
private
Integer
priority
;
private
Integer
priority
;
@ApiModelProperty
(
value
=
"优化方法"
,
required
=
true
,
notes
=
""
)
@ApiModelProperty
(
value
=
"优化方法"
,
required
=
true
,
notes
=
""
)
@NotEmpty
(
message
=
"方法不可为空"
)
private
List
<
IdeaListElement
>
ideaList
;
private
List
<
IdeaListElement
>
ideaList
;
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
View file @
f6bffb09
...
@@ -78,7 +78,8 @@ public class DiagnoServiceImpl implements DiagnoService {
...
@@ -78,7 +78,8 @@ public class DiagnoServiceImpl implements DiagnoService {
SceneService
sceneService
,
SceneMapper
sceneMapper
,
CrossDirInfoMapper
crossDirInfoMapper
,
SceneService
sceneService
,
SceneMapper
sceneMapper
,
CrossDirInfoMapper
crossDirInfoMapper
,
RidInfoMapper
ridInfoMapper
,
CrossSchemeOptLogMapper
crossSchemeOptLogMapper
,
RidInfoMapper
ridInfoMapper
,
CrossSchemeOptLogMapper
crossSchemeOptLogMapper
,
CrossSchemeMapper
crossSchemeMapper
,
CrossPhaseMapper
crossPhaseMapper
,
CrossSchemeMapper
crossSchemeMapper
,
CrossPhaseMapper
crossPhaseMapper
,
FeignProxyService
feignProxyService
,
CrossDataHistMapper
crossDataHistMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
)
{
FeignProxyService
feignProxyService
,
CrossDataHistMapper
crossDataHistMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
)
{
this
.
crossInfoMapper
=
crossInfoMapper
;
this
.
crossInfoMapper
=
crossInfoMapper
;
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
this
.
sceneService
=
sceneService
;
this
.
sceneService
=
sceneService
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/strategy/impl/IdeaServiceImpl.java
View file @
f6bffb09
...
@@ -36,23 +36,24 @@ public class IdeaServiceImpl implements IdeaService {
...
@@ -36,23 +36,24 @@ public class IdeaServiceImpl implements IdeaService {
if
(
ObjectUtil
.
isEmpty
(
id
)
||
id
==
0
)
{
if
(
ObjectUtil
.
isEmpty
(
id
)
||
id
==
0
)
{
// 不传ID为新增
// 不传ID为新增
IdeaPO
ideaPO
=
new
IdeaPO
();
IdeaPO
ideaPO
=
new
IdeaPO
();
ideaPO
.
setIdeaCode
(
addOrUpdateIdeaDTO
.
getIdeaCode
());
fillData
(
addOrUpdateIdeaDTO
,
ideaPO
);
ideaPO
.
setIdeaName
(
addOrUpdateIdeaDTO
.
getIdeaName
());
ideaPO
.
setIdeaTarget
(
addOrUpdateIdeaDTO
.
getIdeaTarget
());
ideaPO
.
setIdeaDetail
(
addOrUpdateIdeaDTO
.
getIdeaDetail
());
ideaMapper
.
insertOne
(
ideaPO
);
ideaMapper
.
insertOne
(
ideaPO
);
}
else
{
}
else
{
// 传ID为修改
// 传ID为修改
IdeaPO
ideaPO
=
new
IdeaPO
();
IdeaPO
ideaPO
=
new
IdeaPO
();
ideaPO
.
setId
(
id
);
ideaPO
.
setId
(
id
);
ideaPO
.
setIdeaCode
(
addOrUpdateIdeaDTO
.
getIdeaCode
());
fillData
(
addOrUpdateIdeaDTO
,
ideaPO
);
ideaPO
.
setIdeaName
(
addOrUpdateIdeaDTO
.
getIdeaName
());
ideaPO
.
setIdeaTarget
(
addOrUpdateIdeaDTO
.
getIdeaTarget
());
ideaPO
.
setIdeaDetail
(
addOrUpdateIdeaDTO
.
getIdeaDetail
());
ideaMapper
.
updateOne
(
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
@Override
public
void
deleteIdea
(
IntegerIdsDTO
integerIdsDTO
)
{
public
void
deleteIdea
(
IntegerIdsDTO
integerIdsDTO
)
{
List
<
Integer
>
ids
=
integerIdsDTO
.
getIds
();
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