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
jinan
traffic-signal-platform
Commits
31190f08
Commit
31190f08
authored
Apr 15, 2025
by
wangyecheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
策略管理优先级配置干线路口回显
parent
0289faac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
15 deletions
+85
-15
StrategyPriorityController.java
...opt/controllerv2/strategy/StrategyPriorityController.java
+8
-5
StrategyPriorityMapper.java
...wanji/opt/dao/mapper/strategy/StrategyPriorityMapper.java
+6
-2
StrategyPriorityService.java
...wanji/opt/servicev2/strategy/StrategyPriorityService.java
+1
-1
StrategyPriorityServiceImpl.java
.../servicev2/strategy/impl/StrategyPriorityServiceImpl.java
+28
-7
StrategyPriorityMapper.xml
...main/resources/mapper/strategy/StrategyPriorityMapper.xml
+42
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controllerv2/strategy/StrategyPriorityController.java
View file @
31190f08
...
...
@@ -110,7 +110,7 @@ public class StrategyPriorityController {
return
jsonView
;
}
@ApiOperation
(
value
=
"策略管理-策略优先级批量保存"
,
notes
=
"批量保存"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
,
hidden
=
false
)
@ApiOperation
(
value
=
"策略管理-策略
路口干线
优先级批量保存"
,
notes
=
"批量保存"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
,
hidden
=
false
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"dataList"
,
value
=
"优先级配置数据"
,
required
=
false
,
dataType
=
"String"
),
})
...
...
@@ -127,15 +127,18 @@ public class StrategyPriorityController {
return
jsonView
;
}
@ApiOperation
(
value
=
"策略管理-策略优先级数据回显"
,
notes
=
"数据回显"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
,
hidden
=
false
)
@ApiOperation
(
value
=
"策略管理-策略
路口干线
优先级数据回显"
,
notes
=
"数据回显"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
,
hidden
=
false
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口id"
,
required
=
true
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口id"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"greenId"
,
value
=
"干线id"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型"
,
required
=
true
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/getPriorityConfig"
)
public
JsonViewObject
getPriorityData
(
@RequestParam
(
required
=
true
)
String
crossId
){
public
JsonViewObject
getPriorityData
(
@RequestParam
(
required
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyFactoryEntity
>
list
=
strategyPriorityService
.
getPriorityData
(
crossId
);
List
<
StrategyFactoryEntity
>
list
=
strategyPriorityService
.
getPriorityData
(
crossId
,
greenId
,
type
);
jsonView
.
success
(
list
);
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
...
...
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/strategy/StrategyPriorityMapper.java
View file @
31190f08
...
...
@@ -69,9 +69,9 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
List
<
String
>
getstrategyNo
(
String
crossId
);
List
<
String
>
getstrategyNo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"type"
)
Integer
type
);
List
<
StrategyFactoryEntity
>
getPriorityConfigData
(
@Param
(
"strategyNo"
)
List
<
String
>
strategyNo
,
@Param
(
"crossId"
)
String
crossId
);
List
<
StrategyFactoryEntity
>
getPriorityConfigData
(
@Param
(
"strategyNo"
)
List
<
String
>
strategyNo
,
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"type"
)
Integer
type
);
void
savePlanConfig
(
@Param
(
"savePlanList"
)
List
<
StrategyPriorityDailyInfo
>
savePlanList
);
...
...
@@ -96,5 +96,9 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
List
<
StrategyPriorityConfig
>
selectGreenPriorityTable
(
Integer
greenId
);
void
deleteGreenPriorityConfig
(
Integer
greenId
);
List
<
String
>
getGreenstrategyNo
(
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"type"
)
Integer
type
);
List
<
StrategyFactoryEntity
>
getGreenPriorityConfigData
(
@Param
(
"strategyNo"
)
List
<
String
>
strategyNo
,
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"type"
)
Integer
type
);
}
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/strategy/StrategyPriorityService.java
View file @
31190f08
...
...
@@ -34,7 +34,7 @@ public interface StrategyPriorityService extends IService<StrategyPriorityDailyI
void
savePriority
(
List
<
StrategyPriorityGroup
>
dataList
);
List
<
StrategyFactoryEntity
>
getPriorityData
(
String
crossId
)
;
List
<
StrategyFactoryEntity
>
getPriorityData
(
String
crossId
,
Integer
greenId
,
Integer
type
)
throws
Exception
;
void
savePlanConfig
(
List
<
StrategyPriorityGroup
>
dailyPlanDetails
)
throws
JsonProcessingException
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/strategy/impl/StrategyPriorityServiceImpl.java
View file @
31190f08
...
...
@@ -82,7 +82,7 @@ import java.util.stream.Collectors;
return
strategyList
;
}
/*
* 策略优先级保存
* 策略优先级保存
路口 干线共用
* */
@Override
@Transactional
...
...
@@ -168,17 +168,38 @@ import java.util.stream.Collectors;
}
}
/*
* 策略优先级路口跟干线数据回显
* */
@Override
@Transactional
public
List
<
StrategyFactoryEntity
>
getPriorityData
(
String
crossId
)
{
public
List
<
StrategyFactoryEntity
>
getPriorityData
(
String
crossId
,
Integer
greenId
,
Integer
type
)
throws
Exception
{
try
{
//先获取策略编号
List
<
String
>
strategyNo
=
strategyPriorityMapper
.
getstrategyNo
(
crossId
);
if
(
CollectionUtils
.
isEmpty
(
strategyNo
)){
return
Collections
.
emptyList
();
List
<
StrategyFactoryEntity
>
priorityList
=
new
ArrayList
<>();
//type: 1路口 2干线
if
(
type
==
1
)
{
if
(
crossId
.
isEmpty
()){
throw
new
IllegalArgumentException
(
"crossId cannot be null"
);
}
//先获取策略编号
List
<
String
>
strategyNo
=
strategyPriorityMapper
.
getstrategyNo
(
crossId
,
type
);
if
(
CollectionUtils
.
isEmpty
(
strategyNo
))
{
return
Collections
.
emptyList
();
}
priorityList
=
strategyPriorityMapper
.
getPriorityConfigData
(
strategyNo
,
crossId
,
type
);
}
else
if
(
type
==
2
){
if
(
greenId
==
null
){
throw
new
IllegalArgumentException
(
"greenId cannot be null"
);
}
//先获取策略编号
List
<
String
>
strategyNo
=
strategyPriorityMapper
.
getGreenstrategyNo
(
greenId
,
type
);
if
(
CollectionUtils
.
isEmpty
(
strategyNo
))
{
return
Collections
.
emptyList
();
}
priorityList
=
strategyPriorityMapper
.
getGreenPriorityConfigData
(
strategyNo
,
greenId
,
type
);
}
List
<
StrategyFactoryEntity
>
priorityList
=
strategyPriorityMapper
.
getPriorityConfigData
(
strategyNo
,
crossId
);
return
priorityList
;
}
catch
(
Exception
e
){
log
.
error
(
"{} getPriorityData"
,
this
.
getClass
().
getSimpleName
(),
e
);
...
...
signal-optimize-service/src/main/resources/mapper/strategy/StrategyPriorityMapper.xml
View file @
31190f08
...
...
@@ -197,7 +197,32 @@
<if
test=
"crossId!=null and crossId!=''"
>
AND t1.cross_id=#{crossId}
</if>
<if
test=
"type!=null and type!=''"
>
AND t1.type=#{type}
</if>
</select>
<select
id=
"getGreenPriorityConfigData"
parameterType=
"map"
resultType=
"net.wanji.opt.synthesis.pojo.StrategyFactoryEntity"
>
SELECT t2.status,
t2.method,t2.strategy_name,t2.strategy_no,
t2.mark,t2.company,t1.priority as priority,t1.id,
t1.group_id as labelCode ,t1.group_name as label,t1.cross_id as crossId
FROM
t_strategy_priority_config t1
LEFT JOIN t_strategy_factory_info t2 on t1.strategy_no=t2.strategy_no and t2.status='1'
WHERE
1=1
AND t1.strategy_no IN
<foreach
item=
"item"
collection=
"strategyNo"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
<if
test=
"greenId!=null and greenId!=''"
>
AND green_id=#{greenId}
</if>
<if
test=
"type!=null and type!=''"
>
AND t1.type=#{type}
</if>
</select>
<select
id=
"getstrategyNo"
resultType=
"java.lang.String"
>
SELECT
strategy_no
...
...
@@ -208,6 +233,23 @@
<if
test=
"crossId!=null and crossId!=''"
>
AND cross_id=#{crossId}
</if>
<if
test=
"type!=null and type!=''"
>
AND type=#{type}
</if>
</select>
<select
id=
"getGreenstrategyNo"
resultType=
"java.lang.String"
>
SELECT
strategy_no
FROM
t_strategy_priority_config
WHERE
1=1
<if
test=
"greenId!=null and greenId!=''"
>
AND green_id=#{greenId}
</if>
<if
test=
"type!=null and type!=''"
>
AND type=#{type}
</if>
</select>
<insert
id=
"savePlanConfig"
parameterType=
"java.util.List"
>
...
...
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