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
bf31bfc1
Commit
bf31bfc1
authored
Apr 28, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略优先级配置删除
parent
3de6c327
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
210 additions
and
63 deletions
+210
-63
StrategyPriorityController.java
...opt/controllerv2/strategy/StrategyPriorityController.java
+77
-62
StrategyPriorityMapper.java
...wanji/opt/dao/mapper/strategy/StrategyPriorityMapper.java
+32
-1
StrategyPriorityService.java
...wanji/opt/servicev2/strategy/StrategyPriorityService.java
+7
-0
StrategyPriorityServiceImpl.java
.../servicev2/strategy/impl/StrategyPriorityServiceImpl.java
+40
-0
StrategyPriorityMapper.xml
...main/resources/mapper/strategy/StrategyPriorityMapper.xml
+54
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controllerv2/strategy/StrategyPriorityController.java
View file @
bf31bfc1
package
net
.
wanji
.
opt
.
controllerv2
.
strategy
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.framework.i18n.I18nResourceBundle
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.entity.strategy.StrategyParameterConfig
;
import
net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
net.wanji.opt.entity.strategy.dto.StrategyPriorityGroupVO
;
import
net.wanji.opt.servicev2.strategy.StrategyPriorityService
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.ws.rs.core.MediaType
;
import
java.util.List
;
/**
* <p>
* 策略优先级日计划详情表 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-28
*/
* <p>
* 策略优先级日计划详情表 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-28
*/
@Api
(
tags
=
"策略管理"
)
@RestController
@RequestMapping
(
"/strategy-priority"
)
...
...
@@ -40,79 +37,78 @@ public class StrategyPriorityController {
private
StrategyPriorityService
strategyPriorityService
;
//策略管理-路口列表
@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 = false, dataType = "String"),
})
@GetMapping
(
"/strategyCrossList"
)
public
JsonViewObject
pageStrategyCrossList
(){
public
JsonViewObject
pageStrategyCrossList
()
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyPriorityDailyInfo
>
retLineData
=
strategyPriorityService
.
pageStrategyCrossList
();
List
<
StrategyPriorityDailyInfo
>
retLineData
=
strategyPriorityService
.
pageStrategyCrossList
();
jsonView
.
success
(
retLineData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getAll error"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonView
;
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
)
@GetMapping
(
"/strategyList"
)
public
JsonViewObject
getStrategyList
(){
public
JsonViewObject
getStrategyList
()
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getStrategyList
();
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getStrategyList
();
jsonView
.
success
(
retLineData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getAll error"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonView
;
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
)
@GetMapping
(
"/sceneList"
)
public
JsonViewObject
getSceneList
(
Integer
type
){
public
JsonViewObject
getSceneList
(
Integer
type
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getSceneList
(
type
);
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getSceneList
(
type
);
jsonView
.
success
(
retLineData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getAll error"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonView
;
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
)
@GetMapping
(
"/companyList"
)
public
JsonViewObject
getCompanyList
(){
public
JsonViewObject
getCompanyList
()
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getCompanyList
();
List
<
StrategyFactoryEntity
>
retLineData
=
strategyPriorityService
.
getCompanyList
();
jsonView
.
success
(
retLineData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getAll error"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonView
;
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"
),
@ApiImplicitParam
(
name
=
"dataList"
,
value
=
"优先级配置数据"
,
required
=
false
,
dataType
=
"String"
),
})
@PostMapping
(
"/savePriority"
)
public
JsonViewObject
savePriority
(
@RequestBody
List
<
StrategyPriorityGroupVO
>
dataList
)
{
public
JsonViewObject
savePriority
(
@RequestBody
List
<
StrategyPriorityGroupVO
>
dataList
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
strategyPriorityService
.
savePriority
(
dataList
);
jsonView
.
success
();
strategyPriorityService
.
savePriority
(
dataList
);
jsonView
.
success
();
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
log
.
error
(
"{} StrategyPriorityController-savePriority"
,
this
.
getClass
().
getSimpleName
(),
e
);
...
...
@@ -120,18 +116,37 @@ 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"
),
})
@PostMapping
(
"/deletePriorityConfigList"
)
public
JsonViewObject
deletePriorityConfigList
(
@RequestBody
List
<
StrategyPriorityGroupVO
>
dataList
)
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
strategyPriorityService
.
deletePriorityConfigList
(
dataList
);
jsonViewObject
.
success
();
}
catch
(
Exception
e
)
{
jsonViewObject
.
fail
(
e
.
getMessage
());
log
.
error
(
"{} StrategyPriorityController-deletePriorityConfigList"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonViewObject
;
}
@ApiOperation
(
value
=
"策略管理-策略路口干线优先级数据回显"
,
notes
=
"数据回显"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
,
hidden
=
false
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口id"
,
required
=
false
,
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
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
){
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
,
greenId
,
type
);
List
<
StrategyFactoryEntity
>
list
=
strategyPriorityService
.
getPriorityData
(
crossId
,
greenId
,
type
);
jsonView
.
success
(
list
);
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
...
...
@@ -140,12 +155,12 @@ 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
=
"dailyPlanDetails"
,
value
=
"日计划配置数据"
,
required
=
false
,
dataType
=
"String"
),
})
@PostMapping
(
"/savePlanConfig"
)
public
JsonViewObject
savePlanConfig
(
@RequestBody
List
<
StrategyPriorityGroupVO
>
dailyPlanDetails
)
{
public
JsonViewObject
savePlanConfig
(
@RequestBody
List
<
StrategyPriorityGroupVO
>
dailyPlanDetails
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
strategyPriorityService
.
savePlanConfig
(
dailyPlanDetails
);
...
...
@@ -157,18 +172,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
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"greenId"
,
value
=
"干线id"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型"
,
required
=
true
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/getPlanConfigData"
)
public
JsonViewObject
getPlanConfigData
(
@RequestParam
(
required
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
){
public
JsonViewObject
getPlanConfigData
(
@RequestParam
(
required
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyPriorityDailyInfo
>
list
=
strategyPriorityService
.
getPlanConfigData
(
crossId
,
greenId
,
type
);
List
<
StrategyPriorityDailyInfo
>
list
=
strategyPriorityService
.
getPlanConfigData
(
crossId
,
greenId
,
type
);
jsonView
.
success
(
list
);
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
...
...
@@ -177,12 +192,12 @@ 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
=
"strategyPriorityGroup"
,
value
=
"参数配置数据"
,
required
=
false
,
dataType
=
"String"
),
})
@PostMapping
(
"/saveParamterConfig"
)
public
JsonViewObject
saveParamterConfig
(
@RequestBody
StrategyPriorityGroupVO
strategyPriorityGroupVO
){
public
JsonViewObject
saveParamterConfig
(
@RequestBody
StrategyPriorityGroupVO
strategyPriorityGroupVO
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
strategyPriorityService
.
saveParamterConfig
(
strategyPriorityGroupVO
);
...
...
@@ -195,18 +210,18 @@ public class StrategyPriorityController {
}
@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
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"greenId"
,
value
=
"干线id"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型"
,
required
=
true
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/getParamConfigData"
)
public
JsonViewObject
getParamConfigData
(
@RequestParam
(
required
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
,
@RequestParam
(
required
=
true
)
String
strategyNo
)
{
public
JsonViewObject
getParamConfigData
(
@RequestParam
(
required
=
false
)
String
crossId
,
@RequestParam
(
required
=
false
)
Integer
greenId
,
@RequestParam
(
required
=
true
)
Integer
type
,
@RequestParam
(
required
=
true
)
String
strategyNo
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyParameterConfig
>
list
=
strategyPriorityService
.
getParamConfigData
(
crossId
,
greenId
,
type
,
strategyNo
);
List
<
StrategyParameterConfig
>
list
=
strategyPriorityService
.
getParamConfigData
(
crossId
,
greenId
,
type
,
strategyNo
);
jsonView
.
success
(
list
);
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
...
...
@@ -218,18 +233,18 @@ public class StrategyPriorityController {
/*
策略管理-干线列表
*/
@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
)
@GetMapping
(
"/getStrategyGreenWave"
)
public
JsonViewObject
getStrategyGreenWave
(){
public
JsonViewObject
getStrategyGreenWave
()
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyPriorityDailyInfo
>
retLineData
=
strategyPriorityService
.
getStrategyGreenWave
();
List
<
StrategyPriorityDailyInfo
>
retLineData
=
strategyPriorityService
.
getStrategyGreenWave
();
jsonView
.
success
(
retLineData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getStrategyGreenWave error"
,
this
.
getClass
().
getSimpleName
(),
e
);
}
return
jsonView
;
return
jsonView
;
}
}
\ No newline at end of file
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/strategy/StrategyPriorityMapper.java
View file @
bf31bfc1
...
...
@@ -115,12 +115,43 @@ public interface StrategyPriorityMapper extends BaseMapper<StrategyPriorityDaily
List
<
StrategyParameterConfig
>
getGreenParamConfigData
(
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"strategyNo"
)
String
strategyNo
);
/**
* 通过路口编号
,分组编号查询策略
详情
* 通过路口编号
或干线编号,分组编号查询策略库
详情
* @param crossId
* @param greenId
* @param groupId
* @return
*/
List
<
StrategyFactoryEntity
>
selectCrossGroupStrategyList
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"groupId"
)
Integer
groupId
);
/**
* 删除路口编号分组下策略编号
* @param crossId
* @param greenId
* @param groupId
* @param strategyNo
* @return
*/
void
deleteGreenPriorityConfig
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"groupId"
)
Integer
groupId
,
@Param
(
"strategyNo"
)
String
strategyNo
);
/**
* 通过路口编号或干线编号,分组编号,查询优先级配置日计划详情
* @param crossId
* @param greenId
* @param groupId
* @return
*/
List
<
StrategyPriorityDailyInfo
>
selectCrossGreenGroupDailyPlanList
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"groupId"
)
Integer
groupId
);
/**
* 通过路口编号或干线编号,分组编号查询策略优先级配置详情
* @param crossId
* @param greenId
* @param groupId
* @return
*/
List
<
StrategyPriorityConfig
>
selectCrossGroupStrategyPriorityList
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"greenId"
)
Integer
greenId
,
@Param
(
"groupId"
)
Integer
groupId
);
}
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/strategy/StrategyPriorityService.java
View file @
bf31bfc1
...
...
@@ -29,6 +29,13 @@ public interface StrategyPriorityService extends IService<StrategyPriorityDailyI
void
savePriority
(
List
<
StrategyPriorityGroupVO
>
dataList
)
throws
Exception
;
/**
* 删除优先级配置表中策略
* @param dataList
* @throws Exception
*/
void
deletePriorityConfigList
(
List
<
StrategyPriorityGroupVO
>
dataList
)
throws
Exception
;
List
<
StrategyFactoryEntity
>
getPriorityData
(
String
crossId
,
Integer
greenId
,
Integer
type
)
throws
Exception
;
void
savePlanConfig
(
List
<
StrategyPriorityGroupVO
>
dailyPlanDetails
)
throws
Exception
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/strategy/impl/StrategyPriorityServiceImpl.java
View file @
bf31bfc1
...
...
@@ -186,6 +186,46 @@ public class StrategyPriorityServiceImpl extends ServiceImpl<StrategyPriorityMap
}
}
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
void
deletePriorityConfigList
(
List
<
StrategyPriorityGroupVO
>
dataList
)
throws
Exception
{
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
Map
<
Integer
,
List
<
StrategyPriorityGroupVO
>>
groupMap
=
dataList
.
stream
().
collect
(
Collectors
.
groupingBy
(
StrategyPriorityGroupVO:
:
getGroupId
));
for
(
Map
.
Entry
<
Integer
,
List
<
StrategyPriorityGroupVO
>>
entry
:
groupMap
.
entrySet
())
{
Integer
groupId
=
entry
.
getKey
();
List
<
StrategyPriorityGroupVO
>
value
=
entry
.
getValue
();
StrategyPriorityGroupVO
groupVO
=
value
.
get
(
0
);
List
<
String
>
crossIds
=
groupVO
.
getCrossIds
();
String
crossId
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
crossIds
))
{
crossId
=
crossIds
.
get
(
0
);
}
List
<
Integer
>
greenIds
=
groupVO
.
getGreenIds
();
Integer
greenId
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
greenIds
))
{
greenId
=
greenIds
.
get
(
0
);
}
// 当全部删除时,1.校验日计划中是否有使用;2.并且删除数量=数据库中数量
List
<
StrategyPriorityConfig
>
data4DB
=
strategyPriorityMapper
.
selectCrossGroupStrategyPriorityList
(
crossId
,
greenId
,
groupId
);
List
<
StrategyPriorityDailyInfo
>
dailyInfos
=
strategyPriorityMapper
.
selectCrossGreenGroupDailyPlanList
(
crossId
,
greenId
,
groupId
);
if
(
CollectionUtils
.
isNotEmpty
(
dailyInfos
)
&&
data4DB
.
size
()
<=
dataList
.
size
())
{
throw
new
RuntimeException
(
"日计划中已使用当前分组: "
+
groupId
+
" 不能清空!"
);
}
// 删除路口编号分组下策略编号
for
(
StrategyPriorityGroupVO
strategyPriorityGroupVO
:
value
)
{
List
<
StrategyPriorityConfig
>
data
=
strategyPriorityGroupVO
.
getData
();
if
(
CollectionUtils
.
isNotEmpty
(
data
))
{
for
(
StrategyPriorityConfig
datum
:
data
)
{
strategyPriorityMapper
.
deleteGreenPriorityConfig
(
crossId
,
greenId
,
groupId
,
datum
.
getStrategyNo
());
}
}
}
}
}
}
/*
* 策略优先级路口跟干线数据回显
* */
...
...
signal-optimize-service/src/main/resources/mapper/strategy/StrategyPriorityMapper.xml
View file @
bf31bfc1
...
...
@@ -436,6 +436,7 @@
WHERE green_id =#{greenId}
</delete>
<!-- 通过路口或者绿波编号,分组编号查询分组中策略信息详情 -->
<select
id=
"selectCrossGroupStrategyList"
resultType=
"net.wanji.opt.synthesis.pojo.StrategyFactoryEntity"
>
select t2.type, t2.scene, t2.strategy_name, t2.strategy_no, t2.method, t2.company,
t2.mark, t2.status, t2.opt_type, t2.create_time, t2.modify_time
...
...
@@ -453,7 +454,60 @@
</if>
order by t1.priority
</where>
</select>
<delete
id=
"deleteGreenPriorityConfig"
>
DELETE
FROM t_strategy_priority_config
<where>
<if
test=
"crossId != null and crossId != ''"
>
and cross_id = #{crossId}
</if>
<if
test=
"greenId!=null and greenId!=''"
>
and green_id = #{greenId}
</if>
<if
test=
"groupId != null and groupId != ''"
>
and group_id = #{groupId}
</if>
<if
test=
"strategyNo != null and strategyNo != ''"
>
and strategy_no = #{strategyNo}
</if>
</where>
</delete>
<!-- 通过路口或者绿波编号,分组编号查询日计划详情 -->
<select
id=
"selectCrossGreenGroupDailyPlanList"
resultType=
"net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo"
>
select daily_plan_id, week_execute, daily_plan_details, cross_id, type, green_id, gmt_create
from t_strategy_priority_daily_info
<where>
<if
test=
"crossId != null and crossId != ''"
>
and cross_id = #{crossId}
</if>
<if
test=
"greenId!=null and greenId!=''"
>
and green_id = #{greenId}
</if>
<if
test=
"groupId != null and groupId != ''"
>
and JSON_CONTAINS(JSON_EXTRACT(daily_plan_details, '$'), JSON_OBJECT('groupId', #{groupId}))
</if>
</where>
</select>
<!-- 通过路口或者绿波编号,分组编号查询策略优先级配置详情 -->
<select
id=
"selectCrossGroupStrategyPriorityList"
resultType=
"net.wanji.opt.entity.strategy.StrategyPriorityDailyInfo"
>
select group_id, group_name, priority, strategy_no, cross_id, green_id, type, gmt_create
from t_strategy_priority_config
<where>
<if
test=
"crossId != null and crossId != ''"
>
and cross_id = #{crossId}
</if>
<if
test=
"greenId!=null and greenId!=''"
>
and green_id = #{greenId}
</if>
<if
test=
"groupId != null and groupId != ''"
>
and group_id = #{groupId}
</if>
</where>
</select>
</mapper>
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