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
e713eeef
Commit
e713eeef
authored
Nov 13, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 策略库管理
parent
eac82065
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
4 deletions
+148
-4
StrategyFactoryMapper.java
.../java/net/wanji/opt/dao/mapper/StrategyFactoryMapper.java
+11
-0
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+37
-0
StrategyFactoryEntity.java
...a/net/wanji/opt/synthesis/pojo/StrategyFactoryEntity.java
+37
-0
StrategyControlService.java
...t/wanji/opt/synthesis/service/StrategyControlService.java
+4
-0
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+48
-4
StrategyFactoryMapper.xml
...rvice/src/main/resources/mapper/StrategyFactoryMapper.xml
+7
-0
AbnormalCrossListVO.java
...c/main/java/net/wanji/databus/vo/AbnormalCrossListVO.java
+4
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/StrategyFactoryMapper.java
0 → 100644
View file @
e713eeef
package
net
.
wanji
.
opt
.
dao
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
/**
* @author duanruiming
* @date 2024/11/13 13:42
*/
public
interface
StrategyFactoryMapper
extends
BaseMapper
<
StrategyFactoryEntity
>
{
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
e713eeef
...
@@ -9,6 +9,7 @@ import net.wanji.opt.dao.mapper.SynthesisOptimizeLogInfoMapper;
...
@@ -9,6 +9,7 @@ import net.wanji.opt.dao.mapper.SynthesisOptimizeLogInfoMapper;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -100,4 +101,40 @@ public class StrategyControlController {
...
@@ -100,4 +101,40 @@ public class StrategyControlController {
public
JsonViewObject
strategyPlanSave
(
@RequestBody
@Validated
StrategyControlDetailList
list
)
throws
Exception
{
public
JsonViewObject
strategyPlanSave
(
@RequestBody
@Validated
StrategyControlDetailList
list
)
throws
Exception
{
return
strategyControlService
.
strategyPlanSave
(
list
);
return
strategyControlService
.
strategyPlanSave
(
list
);
}
}
@ApiOperation
(
value
=
"策略库查询列表"
,
notes
=
"策略库查询列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@GetMapping
(
value
=
"/strategyFactoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyFactoryEntity
.
class
),
})
public
JsonViewObject
strategyFactoryList
()
throws
Exception
{
return
strategyControlService
.
strategyFactoryList
();
}
@ApiOperation
(
value
=
"策略管理计划保存"
,
notes
=
"策略管理计划列表查询"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/strategyFactorySave"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyFactoryEntity
.
class
),
})
public
JsonViewObject
strategyFactorySave
(
@RequestBody
@Validated
StrategyFactoryEntity
entity
)
throws
Exception
{
return
strategyControlService
.
strategyFactorySave
(
entity
);
}
@ApiOperation
(
value
=
"策略管理计划保存"
,
notes
=
"策略管理计划列表查询"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/strategyFactoryDel"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyFactoryEntity
.
class
),
})
public
JsonViewObject
strategyFactoryDel
(
@RequestBody
Integer
id
)
throws
Exception
{
return
strategyControlService
.
strategyFactoryDel
(
id
);
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyFactoryEntity.java
0 → 100644
View file @
e713eeef
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2024/11/13 13:35
*/
@Data
@TableName
(
"t_strategy_factory_info"
)
@ApiModel
(
value
=
"StrategyFactoryEntity"
,
description
=
"策略库实体"
)
public
class
StrategyFactoryEntity
{
@ApiModelProperty
(
"自增Id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"场景"
)
@TableField
(
"scene"
)
private
Integer
scene
;
@ApiModelProperty
(
"策略"
)
@TableField
(
"strategy_name"
)
private
String
strategyName
;
@ApiModelProperty
(
"策略编号"
)
@TableField
(
"strategy_no"
)
private
String
strategyNo
;
@ApiModelProperty
(
"算法厂商"
)
@TableField
(
"company"
)
private
String
company
;
@ApiModelProperty
(
"备注"
)
@TableField
(
"mark"
)
private
String
mark
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/StrategyControlService.java
View file @
e713eeef
...
@@ -4,6 +4,7 @@ import net.wanji.common.framework.rest.JsonViewObject;
...
@@ -4,6 +4,7 @@ import net.wanji.common.framework.rest.JsonViewObject;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDataEntity
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.StrategyControlDetailList
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
import
net.wanji.opt.synthesis.pojo.StrategyFactoryEntity
;
/**
/**
* @author duanruiming
* @author duanruiming
...
@@ -18,4 +19,7 @@ public interface StrategyControlService {
...
@@ -18,4 +19,7 @@ public interface StrategyControlService {
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyPush
(
StrategyControlDetailList
list
)
throws
Exception
;
JsonViewObject
strategyPush
(
StrategyControlDetailList
list
)
throws
Exception
;
JsonViewObject
strategyPlanSave
(
StrategyControlDetailList
list
)
throws
Exception
;
JsonViewObject
strategyPlanSave
(
StrategyControlDetailList
list
)
throws
Exception
;
JsonViewObject
strategyFactoryList
()
throws
Exception
;
JsonViewObject
strategyFactorySave
(
StrategyFactoryEntity
entity
)
throws
Exception
;
JsonViewObject
strategyFactoryDel
(
Integer
id
)
throws
Exception
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
e713eeef
...
@@ -17,6 +17,7 @@ import net.wanji.databus.po.BaseCrossInfoPO;
...
@@ -17,6 +17,7 @@ import net.wanji.databus.po.BaseCrossInfoPO;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.opt.dao.mapper.StrategyControlInfoMapper
;
import
net.wanji.opt.dao.mapper.StrategyControlInfoMapper
;
import
net.wanji.opt.dao.mapper.StrategyDailyPlanInfoMapper
;
import
net.wanji.opt.dao.mapper.StrategyDailyPlanInfoMapper
;
import
net.wanji.opt.dao.mapper.StrategyFactoryMapper
;
import
net.wanji.opt.dao.mapper.StrategyPlanInfoMapper
;
import
net.wanji.opt.dao.mapper.StrategyPlanInfoMapper
;
import
net.wanji.opt.synthesis.pojo.*
;
import
net.wanji.opt.synthesis.pojo.*
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
...
@@ -51,6 +52,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -51,6 +52,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
private
UtcFeignClients
utcFeignClients
;
private
UtcFeignClients
utcFeignClients
;
@Resource
@Resource
private
BaseCrossInfoMapper
baseCrossInfoMapper
;
private
BaseCrossInfoMapper
baseCrossInfoMapper
;
@Resource
private
StrategyFactoryMapper
strategyFactoryMapper
;
@Override
@Override
...
@@ -182,7 +185,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -182,7 +185,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
result
.
setTime
(
""
);
result
.
setTime
(
""
);
}
else
{
}
else
{
String
time
=
entity
.
getTime
();
String
time
=
entity
.
getTime
();
List
<
StrategyControlDataVO
.
TimeTable
>
timeTables
=
instance
.
readValue
(
time
,
new
TypeReference
<
List
<
StrategyControlDataVO
.
TimeTable
>>()
{});
List
<
StrategyControlDataVO
.
TimeTable
>
timeTables
=
instance
.
readValue
(
time
,
new
TypeReference
<
List
<
StrategyControlDataVO
.
TimeTable
>>()
{
});
for
(
StrategyControlDataVO
.
TimeTable
timeTable
:
timeTables
)
{
for
(
StrategyControlDataVO
.
TimeTable
timeTable
:
timeTables
)
{
int
currentWeek
=
DateUtil
.
thisDayOfWeek
();
int
currentWeek
=
DateUtil
.
thisDayOfWeek
();
if
(
currentWeek
!=
timeTable
.
getWeek
())
{
if
(
currentWeek
!=
timeTable
.
getWeek
())
{
...
@@ -235,7 +239,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -235,7 +239,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
executePlan
.
setStatus
(
planInfoEntity
.
getStatus
());
executePlan
.
setStatus
(
planInfoEntity
.
getStatus
());
executePlan
.
setType
(
planInfoEntity
.
getType
());
executePlan
.
setType
(
planInfoEntity
.
getType
());
String
planDetailsStr
=
planInfoEntity
.
getPlanDetails
();
String
planDetailsStr
=
planInfoEntity
.
getPlanDetails
();
List
<
StrategyControlDetailList
.
ExecutePlan
.
PlanDetail
>
planDetails
=
instance
.
readValue
(
planDetailsStr
,
new
TypeReference
<
List
<
StrategyControlDetailList
.
ExecutePlan
.
PlanDetail
>>()
{});
List
<
StrategyControlDetailList
.
ExecutePlan
.
PlanDetail
>
planDetails
=
instance
.
readValue
(
planDetailsStr
,
new
TypeReference
<
List
<
StrategyControlDetailList
.
ExecutePlan
.
PlanDetail
>>()
{
});
executePlan
.
setPlanDetails
(
planDetails
);
executePlan
.
setPlanDetails
(
planDetails
);
executePlans
.
add
(
executePlan
);
executePlans
.
add
(
executePlan
);
}
}
...
@@ -250,7 +255,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -250,7 +255,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
dailyPlan
.
setCrossId
(
dailyPlanInfoEntity
.
getCrossId
());
dailyPlan
.
setCrossId
(
dailyPlanInfoEntity
.
getCrossId
());
dailyPlan
.
setDailyPlanId
(
dailyPlanInfoEntity
.
getDailyPlanId
());
dailyPlan
.
setDailyPlanId
(
dailyPlanInfoEntity
.
getDailyPlanId
());
String
dailyPlanDetailsStr
=
dailyPlanInfoEntity
.
getDailyPlanDetails
();
String
dailyPlanDetailsStr
=
dailyPlanInfoEntity
.
getDailyPlanDetails
();
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>
dailyPlanDetails
=
instance
.
readValue
(
dailyPlanDetailsStr
,
new
TypeReference
<
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>>()
{});
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>
dailyPlanDetails
=
instance
.
readValue
(
dailyPlanDetailsStr
,
new
TypeReference
<
List
<
StrategyControlDetailList
.
DailyPlan
.
DailyPlanDetail
>>()
{
});
dailyPlan
.
setDailyPlanDetails
(
dailyPlanDetails
);
dailyPlan
.
setDailyPlanDetails
(
dailyPlanDetails
);
dailyPlans
.
add
(
dailyPlan
);
dailyPlans
.
add
(
dailyPlan
);
}
}
...
@@ -446,4 +452,42 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -446,4 +452,42 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
return
null
;
return
null
;
}
}
@Override
public
JsonViewObject
strategyFactoryList
()
throws
Exception
{
List
<
StrategyFactoryEntity
>
strategyFactoryEntities
=
strategyFactoryMapper
.
selectList
(
null
);
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
jsonViewObject
.
success
(
strategyFactoryEntities
);
return
jsonViewObject
;
}
@Override
public
JsonViewObject
strategyFactorySave
(
StrategyFactoryEntity
entity
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
if
(
Objects
.
nonNull
(
entity
.
getId
()))
{
strategyFactoryMapper
.
updateById
(
entity
);
}
else
{
strategyFactoryMapper
.
insert
(
entity
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"策略库保存失败:{}"
,
e
);
jsonViewObject
.
success
(
"策略库保存失败"
);
}
return
jsonViewObject
.
success
(
"策略库保存成功"
);
}
@Override
public
JsonViewObject
strategyFactoryDel
(
Integer
id
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
StrategyFactoryEntity
strategyFactoryEntity
=
new
StrategyFactoryEntity
();
strategyFactoryEntity
.
setId
(
id
);
strategyFactoryMapper
.
deleteById
(
strategyFactoryEntity
);
}
catch
(
Exception
e
)
{
log
.
error
(
"策略库策略删除失败:{}"
,
e
);
jsonViewObject
.
success
(
"策略库策略删除失败"
);
}
return
jsonViewObject
.
success
(
"策略库删除成功"
);
}
}
}
signal-optimize-service/src/main/resources/mapper/StrategyFactoryMapper.xml
0 → 100644
View file @
e713eeef
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"net.wanji.opt.dao.mapper.StrategyFactoryMapper"
>
</mapper>
\ No newline at end of file
wj-databus/src/main/java/net/wanji/databus/vo/AbnormalCrossListVO.java
View file @
e713eeef
...
@@ -52,6 +52,10 @@ public class AbnormalCrossListVO {
...
@@ -52,6 +52,10 @@ public class AbnormalCrossListVO {
private
Integer
isCongestion
;
private
Integer
isCongestion
;
@ApiModelProperty
(
value
=
"拥堵指数"
)
@ApiModelProperty
(
value
=
"拥堵指数"
)
private
Double
congestionIndex
;
private
Double
congestionIndex
;
@ApiModelProperty
(
value
=
"失衡指数"
)
private
Double
unbalanceIndex
;
@ApiModelProperty
(
value
=
"溢出指数"
)
private
Double
spilloverIndex
;
@ApiModelProperty
(
value
=
"同比"
,
notes
=
"同比增长率= (本期数 - 同期数) / 同期数 × 100%;同比:取上一周同一时段数据"
)
@ApiModelProperty
(
value
=
"同比"
,
notes
=
"同比增长率= (本期数 - 同期数) / 同期数 × 100%;同比:取上一周同一时段数据"
)
private
Double
lastWeekIndex
;
private
Double
lastWeekIndex
;
@ApiModelProperty
(
value
=
"环比"
,
notes
=
"增长率= (本期数 - 上期数) / 上期数 × 100%;环比:取上一时段数据"
)
@ApiModelProperty
(
value
=
"环比"
,
notes
=
"增长率= (本期数 - 上期数) / 上期数 × 100%;环比:取上一时段数据"
)
...
...
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