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
4aae6fd3
Commit
4aae6fd3
authored
Apr 24, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 神思策略推送
parent
c8d9c5bd
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
719 additions
and
682 deletions
+719
-682
DailyPlanDetails.java
.../java/net/wanji/opt/entity/strategy/DailyPlanDetails.java
+1
-1
StrategyPriorityGroupPushReq.java
...nji/opt/entity/strategy/StrategyPriorityGroupPushReq.java
+14
-0
StrategyPriorityPlanPushReq.java
...anji/opt/entity/strategy/StrategyPriorityPlanPushReq.java
+14
-0
StrategyPriorityServiceImpl.java
.../servicev2/strategy/impl/StrategyPriorityServiceImpl.java
+677
-661
PushStrategyControlService.java
...nji/opt/synthesis/service/PushStrategyControlService.java
+3
-5
PushStrategyControlServiceImpl.java
...ynthesis/service/impl/PushStrategyControlServiceImpl.java
+10
-15
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/entity/strategy/DailyPlanDetails.java
View file @
4aae6fd3
...
@@ -14,7 +14,7 @@ public class DailyPlanDetails {
...
@@ -14,7 +14,7 @@ public class DailyPlanDetails {
//日计划编号
//日计划编号
private
int
dailyPlanId
;
private
int
dailyPlanId
;
//执行时间
//执行时间
private
List
<
String
>
weekExecute
;
private
List
<
Integer
>
weekExecute
;
//时间详情
//时间详情
private
List
<
TimePlanDetails
>
timeDetails
;
private
List
<
TimePlanDetails
>
timeDetails
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/entity/strategy/StrategyPriorityGroupPushReq.java
0 → 100644
View file @
4aae6fd3
package
net
.
wanji
.
opt
.
entity
.
strategy
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2025/04/24 10:27
*/
@Data
public
class
StrategyPriorityGroupPushReq
{
List
<
StrategyPriorityConfigPush
>
data
;
}
signal-optimize-service/src/main/java/net/wanji/opt/entity/strategy/StrategyPriorityPlanPushReq.java
0 → 100644
View file @
4aae6fd3
package
net
.
wanji
.
opt
.
entity
.
strategy
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2025/04/24 10:34
*/
@Data
public
class
StrategyPriorityPlanPushReq
{
List
<
StrategyPriorityPlanPush
>
data
;
}
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/strategy/impl/StrategyPriorityServiceImpl.java
View file @
4aae6fd3
This diff is collapsed.
Click to expand it.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/PushStrategyControlService.java
View file @
4aae6fd3
package
net
.
wanji
.
opt
.
synthesis
.
service
;
package
net
.
wanji
.
opt
.
synthesis
.
service
;
import
net.wanji.opt.entity.strategy.StrategyParameterPush
;
import
net.wanji.opt.entity.strategy.*
;
import
net.wanji.opt.entity.strategy.StrategyPriorityConfigPush
;
import
net.wanji.opt.entity.strategy.StrategyPriorityPlanPush
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlSwitchReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlSwitchReq
;
...
@@ -36,7 +34,7 @@ public interface PushStrategyControlService {
...
@@ -36,7 +34,7 @@ public interface PushStrategyControlService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
Result
StartegyPriorityPush
(
List
<
StrategyPriorityConfigPush
>
req
)
throws
Exception
;
Result
StartegyPriorityPush
(
StrategyPriorityGroupPushReq
req
)
throws
Exception
;
/**
/**
* 策略管理日计划配置推送
* 策略管理日计划配置推送
...
@@ -44,7 +42,7 @@ public interface PushStrategyControlService {
...
@@ -44,7 +42,7 @@ public interface PushStrategyControlService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
Result
StartegyPriorityPlanPush
(
List
<
StrategyPriorityPlanPush
>
req
)
throws
Exception
;
Result
StartegyPriorityPlanPush
(
StrategyPriorityPlanPushReq
req
)
throws
Exception
;
/**
/**
* 策略管理参数配置推送
* 策略管理参数配置推送
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/PushStrategyControlServiceImpl.java
View file @
4aae6fd3
package
net
.
wanji
.
opt
.
synthesis
.
service
.
impl
;
package
net
.
wanji
.
opt
.
synthesis
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.tool.resttool.RestTemplateTool
;
import
net.wanji.common.tool.resttool.RestTemplateTool
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.opt.entity.strategy.StrategyParameterPush
;
import
net.wanji.opt.entity.strategy.*
;
import
net.wanji.opt.entity.strategy.StrategyPriorityConfigPush
;
import
net.wanji.opt.entity.strategy.StrategyPriorityPlanPush
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlSwitchReq
;
import
net.wanji.opt.synthesis.pojo.StrategyControlSwitchReq
;
...
@@ -75,21 +72,19 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
...
@@ -75,21 +72,19 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
* 优先级配置推送
* 优先级配置推送
* */
* */
@Override
@Override
public
Result
StartegyPriorityPush
(
List
<
StrategyPriorityConfigPush
>
req
)
throws
Exception
{
public
Result
StartegyPriorityPush
(
StrategyPriorityGroupPushReq
req
)
throws
Exception
{
try
{
try
{
String
priorityUrl
=
"http://37.12.182.50:8082/api/traffic/strategy/priority/info"
;
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
System
.
out
.
println
(
"req~~"
+
req
);
// 序列化请求参数
// 序列化请求参数
String
jsonReq
=
mapper
.
writeValueAsString
(
req
);
String
jsonReq
=
mapper
.
writeValueAsString
(
req
);
//String jsonString = JSON.toJSONString(req);
String
resultStr
=
RestTemplateTool
.
post
(
priorityUrl
,
jsonReq
);
// System.out.println("请求参数: " + jsonReq);
String
resultStr
=
RestTemplateTool
.
postList
(
switchUrl
,
jsonReq
);
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
log
.
info
(
"下发神思策略管理优先级推送成功,内容: {}"
,
req
);
log
.
info
(
"下发神思策略管理优先级推送成功,内容: {}"
,
req
);
Result
result
=
mapper
.
readValue
(
resultStr
,
Result
.
class
);
Result
result
=
mapper
.
readValue
(
resultStr
,
Result
.
class
);
return
result
;
return
result
;
}
else
{
}
else
{
log
.
error
(
"策略管理优先级推送url:{}失败:返回数据异常"
,
switch
Url
);
log
.
error
(
"策略管理优先级推送url:{}失败:返回数据异常"
,
priority
Url
);
return
new
Result
(
"500"
,
"服务调用失败"
,
null
);
return
new
Result
(
"500"
,
"服务调用失败"
,
null
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -101,19 +96,19 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
...
@@ -101,19 +96,19 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
* 日计划配置推送
* 日计划配置推送
* */
* */
@Override
@Override
public
Result
StartegyPriorityPlanPush
(
List
<
StrategyPriorityPlanPush
>
req
)
throws
Exception
{
public
Result
StartegyPriorityPlanPush
(
StrategyPriorityPlanPushReq
req
)
throws
Exception
{
try
{
try
{
String
planUrl
=
"http://37.12.182.50:8082/api/traffic/strategy/priority/schedule"
;
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
// 序列化请求参数
// 序列化请求参数
String
jsonReq
=
mapper
.
writeValueAsString
(
req
);
String
jsonReq
=
mapper
.
writeValueAsString
(
req
);
System
.
out
.
println
(
"req~~"
+
jsonReq
);
String
resultStr
=
RestTemplateTool
.
post
(
planUrl
,
jsonReq
);
String
resultStr
=
RestTemplateTool
.
postList
(
switchUrl
,
jsonReq
);
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
log
.
info
(
"下发神思策略管理日计划配置推送成功,内容: {}"
,
req
);
log
.
info
(
"下发神思策略管理日计划配置推送成功,内容: {}"
,
req
);
Result
result
=
mapper
.
readValue
(
resultStr
,
Result
.
class
);
Result
result
=
mapper
.
readValue
(
resultStr
,
Result
.
class
);
return
result
;
return
result
;
}
else
{
}
else
{
log
.
error
(
"策略管理日计划配置推送url:{}失败:返回数据异常"
,
switch
Url
);
log
.
error
(
"策略管理日计划配置推送url:{}失败:返回数据异常"
,
plan
Url
);
return
new
Result
(
"500"
,
"服务调用失败"
,
null
);
return
new
Result
(
"500"
,
"服务调用失败"
,
null
);
}
}
}
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