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
5c1a79a2
Commit
5c1a79a2
authored
Nov 13, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 策略库管理路网监测接口
parent
e713eeef
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
1 deletion
+74
-1
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+12
-0
StrategyControlDataEntity.java
...t/wanji/opt/synthesis/pojo/StrategyControlDataEntity.java
+3
-0
StrategyControlDataExt.java
.../net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
+13
-0
StrategyControlService.java
...t/wanji/opt/synthesis/service/StrategyControlService.java
+1
-0
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+45
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
5c1a79a2
...
@@ -67,6 +67,18 @@ public class StrategyControlController {
...
@@ -67,6 +67,18 @@ public class StrategyControlController {
return
strategyControlService
.
crossStrategyInfoList
(
type
);
return
strategyControlService
.
crossStrategyInfoList
(
type
);
}
}
@ApiOperation
(
value
=
"路网优化监测"
,
notes
=
"路网优化监测"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@GetMapping
(
value
=
"/crossOptInfoList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyControlDataEntity
.
class
),
})
public
JsonViewObject
crossOptInfoList
(
@RequestParam
Integer
type
)
throws
Exception
{
return
strategyControlService
.
crossOptInfoList
(
type
);
}
@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
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataEntity.java
View file @
5c1a79a2
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
net.wanji.databus.vo.PageVO
;
import
net.wanji.databus.vo.PageVO
;
...
@@ -28,9 +29,11 @@ public class StrategyControlDataEntity extends PageVO {
...
@@ -28,9 +29,11 @@ public class StrategyControlDataEntity extends PageVO {
private
Integer
strategy
;
private
Integer
strategy
;
/** value = 开始时间日期 */
/** value = 开始时间日期 */
@TableField
(
"schedule_start"
)
@TableField
(
"schedule_start"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
scheduleStart
;
private
Date
scheduleStart
;
/** value = 结束时间日期 */
/** value = 结束时间日期 */
@TableField
(
"schedule_end"
)
@TableField
(
"schedule_end"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
scheduleEnd
;
private
Date
scheduleEnd
;
/** value = 日计划表 */
/** value = 日计划表 */
private
String
time
;
private
String
time
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
0 → 100644
View file @
5c1a79a2
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2024/11/13 19:31
*/
@Data
public
class
StrategyControlDataExt
extends
StrategyControlDataEntity
{
private
String
strategyName
;
private
String
optStatus
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/StrategyControlService.java
View file @
5c1a79a2
...
@@ -15,6 +15,7 @@ public interface StrategyControlService {
...
@@ -15,6 +15,7 @@ public interface StrategyControlService {
JsonViewObject
strategyInfoPageList
(
StrategyControlDataEntity
entity
)
throws
Exception
;
JsonViewObject
strategyInfoPageList
(
StrategyControlDataEntity
entity
)
throws
Exception
;
JsonViewObject
crossStrategyInfoList
(
Integer
type
)
throws
Exception
;
JsonViewObject
crossStrategyInfoList
(
Integer
type
)
throws
Exception
;
JsonViewObject
crossOptInfoList
(
Integer
type
)
throws
Exception
;
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
;
JsonViewObject
strategyPush
(
StrategyControlDetailList
list
)
throws
Exception
;
JsonViewObject
strategyPush
(
StrategyControlDetailList
list
)
throws
Exception
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
5c1a79a2
...
@@ -170,6 +170,16 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -170,6 +170,16 @@ public class StrategyControlServiceImpl implements StrategyControlService {
@Override
@Override
public
JsonViewObject
crossStrategyInfoList
(
Integer
type
)
throws
Exception
{
public
JsonViewObject
crossStrategyInfoList
(
Integer
type
)
throws
Exception
{
try
{
List
<
StrategyControlDataEntity
>
results
=
getCurrentStrateInfoList
(
type
);
return
JsonViewObject
.
newInstance
().
success
(
results
);
}
catch
(
Exception
e
)
{
log
.
error
(
"策略控制查询列表:{}"
,
e
);
throw
new
RuntimeException
(
e
);
}
}
private
List
<
StrategyControlDataEntity
>
getCurrentStrateInfoList
(
Integer
type
)
throws
IllegalAccessException
,
InvocationTargetException
,
JsonProcessingException
{
ObjectMapper
instance
=
JacksonUtils
.
getInstance
();
ObjectMapper
instance
=
JacksonUtils
.
getInstance
();
LambdaQueryWrapper
<
StrategyControlDataEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
StrategyControlDataEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StrategyControlDataEntity:
:
getBizType
,
type
);
queryWrapper
.
eq
(
StrategyControlDataEntity:
:
getBizType
,
type
);
...
@@ -215,9 +225,39 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -215,9 +225,39 @@ public class StrategyControlServiceImpl implements StrategyControlService {
result
.
setCrossName
(
baseCrossInfoPO
.
getName
());
result
.
setCrossName
(
baseCrossInfoPO
.
getName
());
results
.
add
(
result
);
results
.
add
(
result
);
}
}
return
JsonViewObject
.
newInstance
().
success
(
results
)
;
return
results
;
}
}
@Override
public
JsonViewObject
crossOptInfoList
(
Integer
type
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
List
<
StrategyControlDataEntity
>
currentStrateInfoList
=
getCurrentStrateInfoList
(
type
);
List
<
StrategyControlDataEntity
>
currentList
=
currentStrateInfoList
.
stream
()
.
filter
(
entity
->
StringUtils
.
isNotBlank
(
entity
.
getTime
())
&&
entity
.
getStatus
()
==
1
).
collect
(
Collectors
.
toList
());
List
<
StrategyFactoryEntity
>
strategyFactoryEntities
=
strategyFactoryMapper
.
selectList
(
null
);
List
<
StrategyControlDataExt
>
strategyControlDataExts
=
new
ArrayList
<>();
for
(
StrategyControlDataEntity
strategyControlDataEntity
:
currentList
)
{
Integer
strategy
=
strategyControlDataEntity
.
getStrategy
();
StrategyControlDataExt
strategyControlDataExt
=
new
StrategyControlDataExt
();
BeanUtils
.
copyProperties
(
strategyControlDataExt
,
strategyControlDataEntity
);
String
strategyName
=
""
;
for
(
StrategyFactoryEntity
strategyFactoryEntity
:
strategyFactoryEntities
)
{
if
(
strategy
==
strategyFactoryEntity
.
getScene
())
{
strategyName
=
strategyFactoryEntity
.
getStrategyName
();
}
}
strategyControlDataExt
.
setStrategyName
(
strategyName
);
strategyControlDataExt
.
setOptStatus
(
"优化中"
);
strategyControlDataExts
.
add
(
strategyControlDataExt
);
}
return
jsonViewObject
.
success
(
strategyControlDataExts
,
"路网优化监测查询成功"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"路网优化监测查询失败: {}"
,
e
);
return
jsonViewObject
.
fail
(
"路网优化监测查询失败"
);
}
}
@Override
@Override
public
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
{
public
JsonViewObject
strategyPlanDetail
(
String
crossId
)
throws
Exception
{
...
@@ -285,6 +325,10 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -285,6 +325,10 @@ public class StrategyControlServiceImpl implements StrategyControlService {
planInfoEntity
.
setEndTime
(
plan
.
getEndTime
());
planInfoEntity
.
setEndTime
(
plan
.
getEndTime
());
planInfoEntity
.
setCompany
(
plan
.
getCompany
());
planInfoEntity
.
setCompany
(
plan
.
getCompany
());
planInfoEntity
.
setPlanDetails
(
mapper
.
writeValueAsString
(
plan
.
getPlanDetails
()));
planInfoEntity
.
setPlanDetails
(
mapper
.
writeValueAsString
(
plan
.
getPlanDetails
()));
LambdaQueryWrapper
<
StrategyPlanInfoEntity
>
planDel
=
new
LambdaQueryWrapper
<>();
planDel
.
eq
(
StrategyPlanInfoEntity:
:
getCrossId
,
plan
.
getCrossId
());
planDel
.
eq
(
StrategyPlanInfoEntity:
:
getPlanId
,
plan
.
getPlanId
());
strategyPlanInfoMapper
.
delete
(
planDel
);
strategyPlanInfoMapper
.
insert
(
planInfoEntity
);
strategyPlanInfoMapper
.
insert
(
planInfoEntity
);
}
}
}
}
...
...
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