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
0711ba8f
Commit
0711ba8f
authored
Feb 14, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略库管理保存添加策略编号唯一校验
parent
c1f3a9f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+1
-1
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+23
-19
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
0711ba8f
...
@@ -163,7 +163,7 @@ public class StrategyControlController {
...
@@ -163,7 +163,7 @@ public class StrategyControlController {
return
strategyControlService
.
strategyFactoryList
(
null
);
return
strategyControlService
.
strategyFactoryList
(
null
);
}
}
@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
)
@PostMapping
(
value
=
"/strategyFactorySave"
,
@PostMapping
(
value
=
"/strategyFactorySave"
,
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
0711ba8f
...
@@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.framework.Constants
;
import
net.wanji.common.framework.Constants
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.utils.OkHttpClientUtil
;
import
net.wanji.common.utils.tool.DateUtil
;
import
net.wanji.common.utils.tool.DateUtil
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.databus.dao.entity.GreenwaveInfoPO
;
import
net.wanji.databus.dao.entity.GreenwaveInfoPO
;
...
@@ -23,7 +22,6 @@ import net.wanji.opt.cache.GreenWaveInfoCache;
...
@@ -23,7 +22,6 @@ import net.wanji.opt.cache.GreenWaveInfoCache;
import
net.wanji.opt.common.enums.GreenBeltDirEnum
;
import
net.wanji.opt.common.enums.GreenBeltDirEnum
;
import
net.wanji.opt.common.enums.StrategyControlEnum
;
import
net.wanji.opt.common.enums.StrategyControlEnum
;
import
net.wanji.opt.dao.mapper.*
;
import
net.wanji.opt.dao.mapper.*
;
import
net.wanji.opt.dto.StrategyOptTimesDTO
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
net.wanji.opt.synthesis.enums.StrategyCrossAlgoEnum
;
import
net.wanji.opt.synthesis.enums.StrategyCrossAlgoEnum
;
import
net.wanji.opt.synthesis.pojo.*
;
import
net.wanji.opt.synthesis.pojo.*
;
...
@@ -782,23 +780,23 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -782,23 +780,23 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
List
<
StrategyControlDetailList
.
DailyPlan
>
dailyPlans
=
list
.
getDailyPlans
();
List
<
StrategyControlDetailList
.
DailyPlan
>
dailyPlans
=
list
.
getDailyPlans
();
if
(!
CollectionUtils
.
isEmpty
(
dailyPlans
))
{
if
(!
CollectionUtils
.
isEmpty
(
dailyPlans
))
{
StrategyControlDetailList
.
DailyPlan
dailyPlan1
=
dailyPlans
.
get
(
0
);
StrategyControlDetailList
.
DailyPlan
dailyPlan1
=
dailyPlans
.
get
(
0
);
LambdaQueryWrapper
<
StrategyDailyPlanInfoEntity
>
delete
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
StrategyDailyPlanInfoEntity
>
delete
=
new
LambdaQueryWrapper
<>();
delete
.
eq
(
StrategyDailyPlanInfoEntity:
:
getCrossId
,
dailyPlan1
.
getCrossId
());
delete
.
eq
(
StrategyDailyPlanInfoEntity:
:
getCrossId
,
dailyPlan1
.
getCrossId
());
strategyDailyPlanInfoMapper
.
delete
(
delete
);
strategyDailyPlanInfoMapper
.
delete
(
delete
);
for
(
StrategyControlDetailList
.
DailyPlan
dailyPlan
:
dailyPlans
)
{
for
(
StrategyControlDetailList
.
DailyPlan
dailyPlan
:
dailyPlans
)
{
Integer
dailyPlanId
=
dailyPlan
.
getDailyPlanId
();
Integer
dailyPlanId
=
dailyPlan
.
getDailyPlanId
();
String
crossId
=
dailyPlan
.
getCrossId
();
String
crossId
=
dailyPlan
.
getCrossId
();
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>
dailyPlanDetails
=
dailyPlan
.
getDailyPlanDetails
();
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>
dailyPlanDetails
=
dailyPlan
.
getDailyPlanDetails
();
StrategyDailyPlanInfoEntity
dailyPlanInfoEntity
=
new
StrategyDailyPlanInfoEntity
();
StrategyDailyPlanInfoEntity
dailyPlanInfoEntity
=
new
StrategyDailyPlanInfoEntity
();
dailyPlanInfoEntity
.
setCrossId
(
crossId
);
dailyPlanInfoEntity
.
setCrossId
(
crossId
);
dailyPlanInfoEntity
.
setDailyPlanId
(
dailyPlanId
);
dailyPlanInfoEntity
.
setDailyPlanId
(
dailyPlanId
);
dailyPlanInfoEntity
.
setName
(
dailyPlan
.
getName
());
dailyPlanInfoEntity
.
setName
(
dailyPlan
.
getName
());
dailyPlanInfoEntity
.
setDailyPlanDetails
(
mapper
.
writeValueAsString
(
dailyPlanDetails
));
dailyPlanInfoEntity
.
setDailyPlanDetails
(
mapper
.
writeValueAsString
(
dailyPlanDetails
));
strategyDailyPlanInfoMapper
.
insert
(
dailyPlanInfoEntity
);
strategyDailyPlanInfoMapper
.
insert
(
dailyPlanInfoEntity
);
}
}
}
}
}
}
StrategyControlVO
strategyControlVO
=
convertDataList
(
list
);
StrategyControlVO
strategyControlVO
=
convertDataList
(
list
);
StrategyControlReq
req
=
convertReq
(
strategyControlVO
);
StrategyControlReq
req
=
convertReq
(
strategyControlVO
);
...
@@ -1074,6 +1072,12 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -1074,6 +1072,12 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if
(
Objects
.
nonNull
(
entity
.
getId
()))
{
if
(
Objects
.
nonNull
(
entity
.
getId
()))
{
strategyFactoryMapper
.
updateById
(
entity
);
strategyFactoryMapper
.
updateById
(
entity
);
}
else
{
}
else
{
LambdaQueryWrapper
<
StrategyFactoryEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StrategyFactoryEntity:
:
getStrategyNo
,
entity
.
getStrategyNo
());
List
<
StrategyFactoryEntity
>
entities
=
strategyFactoryMapper
.
selectList
(
queryWrapper
);
if
(
Objects
.
nonNull
(
entities
)
&&
entities
.
size
()
>
0
)
{
return
jsonViewObject
.
fail
(
"策略编号重复"
);
}
strategyFactoryMapper
.
insert
(
entity
);
strategyFactoryMapper
.
insert
(
entity
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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