Commit 8212c996 authored by duanruiming's avatar duanruiming

[add] 路口优化->方案优化记录表添加data_extend

parent d19cb0f3
...@@ -106,7 +106,7 @@ public class PhaseDirTurnCache implements CommandLineRunner { ...@@ -106,7 +106,7 @@ public class PhaseDirTurnCache implements CommandLineRunner {
} }
} }
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
log.info("加载区域基础信息到缓存耗时:{}s,条数据,size={}", (end - start), phaseMap.size()); log.info("加载区域基础信息到缓存耗时:{}ms,条数据,size={}", (end - start), phaseMap.size());
} catch (Exception e) { } catch (Exception e) {
log.error("相位方向转向缓存初始化失败", e); log.error("相位方向转向缓存初始化失败", e);
} }
......
...@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiResponse; ...@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.service.signalcontrol.FeignProxyService; import net.wanji.opt.service.signalcontrol.FeignProxyService;
import net.wanji.opt.vo.GreenwaveVO;
import net.wanji.opt.vo.SchemeOptSendVO; import net.wanji.opt.vo.SchemeOptSendVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -31,11 +30,9 @@ public class SignalCommandOptController { ...@@ -31,11 +30,9 @@ public class SignalCommandOptController {
@ApiOperation(value = "手动优化方案下发", notes = "优化方案下发", response = JsonViewObject.class, @ApiOperation(value = "手动优化方案下发", notes = "优化方案下发", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/greenwaveList", @PostMapping(value = "/schemeOptSend",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
@ApiResponse(code = 200, message = "OK", response = GreenwaveVO.class),
})
public JsonViewObject schemeOptSend(@RequestBody @Validated SchemeOptSendVO schemeOptSendVO) throws Exception{ public JsonViewObject schemeOptSend(@RequestBody @Validated SchemeOptSendVO schemeOptSendVO) throws Exception{
JsonViewObject jsonViewObject = feignProxyService.schemeOptSend(schemeOptSendVO); JsonViewObject jsonViewObject = feignProxyService.schemeOptSend(schemeOptSendVO);
return jsonViewObject; return jsonViewObject;
......
...@@ -33,5 +33,6 @@ public class CrossSchemeOptLogPO { ...@@ -33,5 +33,6 @@ public class CrossSchemeOptLogPO {
private String optResultDesc; private String optResultDesc;
private int dataBatchTime; private int dataBatchTime;
private String restoreResult; private String restoreResult;
private String dataExtend;
} }
...@@ -455,9 +455,10 @@ public class CrossOptimizeServiceImpl implements CrossOptimizeService { ...@@ -455,9 +455,10 @@ public class CrossOptimizeServiceImpl implements CrossOptimizeService {
crossSchemeOptLogPO.setOptType("1");// 自动优化 crossSchemeOptLogPO.setOptType("1");// 自动优化
crossSchemeOptLogPO.setOptType(optType); crossSchemeOptLogPO.setOptType(optType);
crossSchemeOptLogPO.setOptResult(StatusCodeEnum.STATUS_00200.getMessage()); crossSchemeOptLogPO.setOptResult("1");
crossSchemeOptLogPO.setOptResultDesc(StatusCodeEnum.STATUS_00200.getDetail()); crossSchemeOptLogPO.setOptResultDesc(StatusCodeEnum.STATUS_00200.getDetail());
crossSchemeOptLogPO.setDataBatchTime((int) dataBatchTimeLong); crossSchemeOptLogPO.setDataBatchTime((int) dataBatchTimeLong);
crossSchemeOptLogPO.setDataExtend("");// todo 需要通过场景策略方法
String phaseNo = crossPhaseDTO.getPhaseNo(); String phaseNo = crossPhaseDTO.getPhaseNo();
for (Map.Entry<String, Integer> entry : phaseTimeOptResultMap.entrySet()) { for (Map.Entry<String, Integer> entry : phaseTimeOptResultMap.entrySet()) {
......
...@@ -2,6 +2,7 @@ package net.wanji.opt.service.signalcontrol.impl; ...@@ -2,6 +2,7 @@ package net.wanji.opt.service.signalcontrol.impl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.entity.develop.servicedevelop.develop.StatusCodeEnum;
import net.wanji.feign.pojo.vo.SchemeSendVO; import net.wanji.feign.pojo.vo.SchemeSendVO;
import net.wanji.feign.service.UtcFeignClients; import net.wanji.feign.service.UtcFeignClients;
import net.wanji.opt.cache.PhaseDirTurnCache; import net.wanji.opt.cache.PhaseDirTurnCache;
...@@ -102,8 +103,8 @@ public class FeignProxyServiceImpl implements FeignProxyService { ...@@ -102,8 +103,8 @@ public class FeignProxyServiceImpl implements FeignProxyService {
crossSchemeOptLogPO.setStartTime(new Date()); crossSchemeOptLogPO.setStartTime(new Date());
crossSchemeOptLogPO.setIsRelation(schemeOptSendVO.getRelationFlag()); crossSchemeOptLogPO.setIsRelation(schemeOptSendVO.getRelationFlag());
crossSchemeOptLogPO.setRelationCrossId(schemeOptSendVO.getRelationCrossId()); crossSchemeOptLogPO.setRelationCrossId(schemeOptSendVO.getRelationCrossId());
crossSchemeOptLogPO.setOptResult("成功"); crossSchemeOptLogPO.setOptResult("1");
crossSchemeOptLogPO.setOptResultDesc("成功"); crossSchemeOptLogPO.setOptResultDesc(StatusCodeEnum.STATUS_00200.getDetail());
crossSchemeOptLogPO.setDataBatchTime((int) dataBatchTimeLong); crossSchemeOptLogPO.setDataBatchTime((int) dataBatchTimeLong);
} }
} }
......
...@@ -110,6 +110,7 @@ public class CrossMonitorTask { ...@@ -110,6 +110,7 @@ public class CrossMonitorTask {
// todo 对数据进行处理,可能主要是CrossTurnDataRealtimeDTO中的车间距,车时距等配置修改 // todo 对数据进行处理,可能主要是CrossTurnDataRealtimeDTO中的车间距,车时距等配置修改
CrossTurnDataRealtimeDTO crossTurnDataRealtimeDTO = new CrossTurnDataRealtimeDTO(); CrossTurnDataRealtimeDTO crossTurnDataRealtimeDTO = new CrossTurnDataRealtimeDTO();
// todo 通过获取场景,策略,方法参数,判断下发方案数据
return crossDataRealtimePOList; return crossDataRealtimePOList;
} }
......
...@@ -29,4 +29,6 @@ public class SchemeOptSendVO extends SchemeSendVO { ...@@ -29,4 +29,6 @@ public class SchemeOptSendVO extends SchemeSendVO {
@ApiModelProperty(value = "相位号-相位调整时间map") @ApiModelProperty(value = "相位号-相位调整时间map")
@NotEmpty @NotEmpty
private Map<String, Integer> phaseOffsetTimeMap; private Map<String, Integer> phaseOffsetTimeMap;
@ApiModelProperty(value = "数据拓展json字段")
private String dataExtend;
} }
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
<result property="optResultDesc" column="opt_result_desc"/> <result property="optResultDesc" column="opt_result_desc"/>
<result property="dataBatchTime" column="data_batch_time"/> <result property="dataBatchTime" column="data_batch_time"/>
<result property="restoreResult" column="restore_result"/> <result property="restoreResult" column="restore_result"/>
<result property="dataExtend" column="data_extend"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, cross_id, scheme_no, dir_type, turn_type, offset, ring_no, phase_no, phase_order_id, ori_green_time, id, cross_id, scheme_no, dir_type, turn_type, offset, ring_no, phase_no, phase_order_id, ori_green_time,
opt_time, opt_type, opt_reason, start_time, end_time, is_relation, relation_cross_id, opt_result, opt_result_desc, opt_time, opt_type, opt_reason, start_time, end_time, is_relation, relation_cross_id, opt_result, opt_result_desc,
data_batch_time, restore_result data_batch_time, restore_result, data_extend
</sql> </sql>
<select id="selectByCrossId" parameterType="String" resultMap="BaseResultMap"> <select id="selectByCrossId" parameterType="String" resultMap="BaseResultMap">
...@@ -49,10 +50,10 @@ ...@@ -49,10 +50,10 @@
phase_order_id, ori_green_time, opt_time, opt_type, opt_reason, phase_order_id, ori_green_time, opt_time, opt_type, opt_reason,
start_time, start_time,
end_time, is_relation, relation_cross_id, opt_result, opt_result_desc, end_time, is_relation, relation_cross_id, opt_result, opt_result_desc,
data_batch_time, restore_result) data_batch_time, restore_result, data_extend)
values (#{crossId}, #{schemeNo}, #{dirType}, #{turnType}, #{offset}, #{ringNo}, #{phaseNo}, #{phaseOrderId}, values (#{crossId}, #{schemeNo}, #{dirType}, #{turnType}, #{offset}, #{ringNo}, #{phaseNo}, #{phaseOrderId},
#{oriGreenTime}, #{optTime}, #{optType}, #{optReason}, #{startTime}, #{endTime}, #{isRelation}, #{oriGreenTime}, #{optTime}, #{optType}, #{optReason}, #{startTime}, #{endTime}, #{isRelation},
#{relationCrossId}, #{optResult}, #{optResultDesc}, #{dataBatchTime}, #{restoreResult}) #{relationCrossId}, #{optResult}, #{optResultDesc}, #{dataBatchTime}, #{restoreResult}, #{dataExtend})
</insert> </insert>
<insert id="insertBatch" parameterType="net.wanji.opt.po.base.CrossSchemeOptLogPO"> <insert id="insertBatch" parameterType="net.wanji.opt.po.base.CrossSchemeOptLogPO">
...@@ -60,12 +61,12 @@ ...@@ -60,12 +61,12 @@
(cross_id, scheme_no, dir_type, turn_type, offset, ring_no, phase_no, (cross_id, scheme_no, dir_type, turn_type, offset, ring_no, phase_no,
phase_order_id, ori_green_time, opt_time, opt_type, opt_reason, phase_order_id, ori_green_time, opt_time, opt_type, opt_reason,
start_time, end_time, is_relation, relation_cross_id, opt_result, opt_result_desc, start_time, end_time, is_relation, relation_cross_id, opt_result, opt_result_desc,
data_batch_time, restore_result) data_batch_time, restore_result, data_extend)
values values
<foreach collection="list" item="entity" separator=","> <foreach collection="list" item="entity" separator=",">
(#{entity.crossId}, #{entity.schemeNo}, #{entity.dirType}, #{entity.turnType}, #{entity.offset}, #{entity.ringNo}, #{entity.phaseNo}, #{entity.phaseOrderId}, (#{entity.crossId}, #{entity.schemeNo}, #{entity.dirType}, #{entity.turnType}, #{entity.offset}, #{entity.ringNo}, #{entity.phaseNo}, #{entity.phaseOrderId},
#{entity.oriGreenTime}, #{entity.optTime}, #{entity.optType}, #{entity.optReason}, #{entity.startTime}, #{entity.endTime}, #{entity.isRelation}, #{entity.oriGreenTime}, #{entity.optTime}, #{entity.optType}, #{entity.optReason}, #{entity.startTime}, #{entity.endTime}, #{entity.isRelation},
#{entity.relationCrossId}, #{entity.optResult}, #{entity.optResultDesc}, #{entity.dataBatchTime}, #{entity.restoreResult}) #{entity.relationCrossId}, #{entity.optResult}, #{entity.optResultDesc}, #{entity.dataBatchTime}, #{entity.restoreResult}, #{entity.dataExtend})
</foreach> </foreach>
</insert> </insert>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment