Commit 1292b73f authored by wangyecheng's avatar wangyecheng

Merge remote-tracking branch 'origin/master'

parents b80cfadb 967f0e0a
...@@ -164,6 +164,23 @@ ...@@ -164,6 +164,23 @@
<artifactId>artemis-http-client</artifactId> <artifactId>artemis-http-client</artifactId>
<version>1.1.3</version> <version>1.1.3</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package net.wanji.opt.controllerv2.report;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.controllerv2.report.design.CrossOptimizeAnalysisResult;
import net.wanji.opt.controllerv2.report.design.GreenWaveOptimizeAnalysisResult;
import net.wanji.opt.controllerv2.report.design.ImportCrossReportAnalysis;
import net.wanji.opt.controllerv2.report.design.ImportGreenReportAnalysis;
import net.wanji.opt.controllerv2.report.vo.GreenWaveOptimizeAnalysisResultResponseDTO;
import net.wanji.opt.controllerv2.report.vo.ImportGreenReportAnalysisResponseVO;
import net.wanji.opt.servicev2.report.AnalysisGreenWaveOptimizeWeekService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 干线概况 接口API
* </p>
* @version 1.0
* @author
* @Date 2025-03-18
*/
@RestController
@Slf4j
@RequestMapping("/cross-optimize")
@Api(value="CrossOptimizeAnalysisController", description="路口分析报告", tags = "路口分析报告-周报")
public class CrossOptimizeAnalysisController {
@ApiOperation(httpMethod="GET",value="4.1-路口优化-总体分析", notes="")
@ApiImplicitParams({
@ApiImplicitParam(name = "crossIds", value = "干线ID,多个id用','分隔【为空时查询所有干线】", required = false, dataType = "String",defaultValue = "13NEJ0B5R80,13N650B5P30"),
@ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "String",defaultValue = "2025"),
@ApiImplicitParam(name = "week", value = "一年的第几周", required = true, dataType = "String",defaultValue = "14"),
})
@GetMapping(value = "/getTotalityData")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossOptimizeAnalysisResult.class),
})
public JsonViewObject getTotalityData(Integer year,Integer week,@RequestParam(required = false) String crossIds) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
@ApiOperation(httpMethod="GET",value="4.2-重点路口优化分析", notes="")
@ApiImplicitParams({
@ApiImplicitParam(name = "crossIds", value = "干线ID,多个id用','分隔【为空时查询所有干线】", required = false, dataType = "String",defaultValue = "13NEJ0B5R80,13N650B5P30"),
@ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "String",defaultValue = "2025"),
@ApiImplicitParam(name = "week", value = "一年的第几周", required = true, dataType = "String",defaultValue = "14"),
})
@GetMapping(value = "/getProblemDetail")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = ImportCrossReportAnalysis.class),
})
public JsonViewObject getProblemDetail(Integer year,Integer week,@RequestParam(required = false) String crossIds) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
}
package net.wanji.opt.controllerv2.report;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.controllerv2.report.design.CrossRunStateAnalysisResult;
import net.wanji.opt.controllerv2.report.design.CrossRunStatePeakAnalysisResult;
import net.wanji.opt.controllerv2.report.design.GreenReportRunStateResult;
import net.wanji.opt.servicev2.report.AnalysisGreenWavePeakDetailService;
import net.wanji.opt.vo2.report.GreenReportRunStateResponseVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 路口运行状态 接口API
* </p>
* @version 1.0
* @author
* @Date 2025-03-18
*/
@RestController
@Slf4j
@RequestMapping("/cross-run-state")
@Api(value="CrossRunStateController", description="", tags = "路口分析报告-周报")
public class CrossRunStateController {
@ApiOperation(httpMethod="GET",value="2.1-交通运行总体情况", notes="")
@ApiImplicitParams({
@ApiImplicitParam(name = "crossIds", value = "路口ID,多个id用','分隔【为空时查询所有】", required = true, dataType = "String",defaultValue = "13NEJ0B5R80,13N650B5P30"),
@ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "String",defaultValue = "2025"),
@ApiImplicitParam(name = "week", value = "一年的第几周", required = true, dataType = "String",defaultValue = "14"),
})
@GetMapping(value = "/getTotalitySituation")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossRunStateAnalysisResult.class),
})
public JsonViewObject getTotalitySituation(String crossIds,Integer year,Integer week) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
@ApiOperation(httpMethod="GET",value="2.2-区域路口运行分析", notes="")
@ApiImplicitParams({
@ApiImplicitParam(name = "crossIds", value = "路口ID,多个id用','分隔【为空时查询所有】", required = true, dataType = "String",defaultValue = "13NEJ0B5R80,13N650B5P30"),
@ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "String",defaultValue = "2025"),
@ApiImplicitParam(name = "week", value = "一年的第几周", required = true, dataType = "String",defaultValue = "14"),
})
@GetMapping(value = "/getPeakData")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossRunStatePeakAnalysisResult.class),
})
public JsonViewObject getPeakData(String crossIds,Integer year,Integer week) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
}
package net.wanji.opt.controllerv2.report.design;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.controllerv2.judgeanalysis.design.response.ParentResult;
import java.util.ArrayList;
import java.util.List;
@Data
public class CrossOptimizeAnalysisResult extends ParentResult {
private CrossOptimizeResultResponse content;
public CrossOptimizeResultResponse getContent() {
return content;
}
public CrossOptimizeAnalysisResult setContent(CrossOptimizeResultResponse content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class CrossOptimizeResultResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周优化次数", example = "300次",position = 1)
private String weekOptimizeCount;
@ApiModelProperty(value = "本周优化时长", example = "98小时",position = 2)
private String weekOptimizeDuration;
@ApiModelProperty(value = "本周溢出次数", example = "98小时",position = 3)
private String weekOptimizeOverflowCount;
@ApiModelProperty(value = "本周拥堵次数", example = "98小时",position = 4)
private String weekOptimizeCongestCount;
@ApiModelProperty(value = "本周空放优化次数", example = "98小时",position = 5)
private String weekOptimizeEmptyCount;
@ApiModelProperty(value = "本周失衡优化次数", example = "98小时",position = 6)
private String weekOptimizeUnbalanceCount;
@ApiModelProperty(value = "本周通行能力同比情况", example = "提升10%",position = 7)
private String weekCapacitySituation;
@ApiModelProperty(value = "本周通停车次数同比情况", example = "减少10%",position = 8)
private String weekStopTimesSituation;
@ApiModelProperty(value = "本周通延误时间同比情况", example = "增加10%",position = 9)
private String weekDelayTimeSituation;
@ApiModelProperty(value = "本周通最大排队同比情况", example = "降低10%",position = 10)
private String weekMaxQueueLengthSituation;
@ApiModelProperty(value = "本周总体情况", example = "明显提升",position = 11)
private String weekTotalitySituation;
//================================================================================================//
@ApiModelProperty(value = "时段列表",example = "[\"本周\",\"上周\"]")
private List<String> timeList = new ArrayList<>();
private List<CrossOptimizeAnalysisData> dataList=new ArrayList<>();
}
@Data
class CrossOptimizeAnalysisData {
@ApiModelProperty(value = "通行能力",example = "8900")
private Integer capacity ;
@ApiModelProperty(value = "停车次数",example = "5")
private Double stopTimes ;
@ApiModelProperty(value = "延误时间,单位秒",example = "40")
private Double delayTime ;
@ApiModelProperty(value = "最大排队长度",example = "6.9")
private Double maxQueueLength ;
}
package net.wanji.opt.controllerv2.report.design;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.controllerv2.judgeanalysis.design.response.ParentResult;
import java.util.ArrayList;
import java.util.List;
@Data
public class CrossRunStateAnalysisResult extends ParentResult {
private CrossRunStateAnalysisResultResponse content;
public CrossRunStateAnalysisResultResponse getContent() {
return content;
}
public CrossRunStateAnalysisResult setContent(CrossRunStateAnalysisResultResponse content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class CrossRunStateAnalysisResultResponse {
@ApiModelProperty(value = "区域周最大流量路口名称", example = "经十路(舜耕路-山大路)")
private String maxFlowCrossName;
@ApiModelProperty(value = "区域周交通指数最大路口名称", example = "经十路(舜耕路-山大路)")
private String maxTrafficIndexCrossName;
@ApiModelProperty(value = "工作日平均流量", example = "13459899辆")
private String workDayAvgFlow;
@ApiModelProperty(value = "工作日早高峰最大小时流量", example = "35490辆")
private String workDayAmPeakMaxHourFlow;
@ApiModelProperty(value = "工作日晚高峰最大小时流量", example = "23454辆")
private String workDayPmPeakMaxHourFlow;
@ApiModelProperty(value = "工作日平峰最大小时流量", example = "234598辆")
private String workDayFmPeakMaxHourFlow;
@ApiModelProperty(value = "周末全天平均流量", example = "234598辆%")
private String weekEndAvgFlow;
@ApiModelProperty(value = "工作日早高峰平均交通指数", example = "4.5")
private String workDayAmPeakAvgTrafficIndex;
@ApiModelProperty(value = "工作日晚高峰平均交通指数", example = "5.5")
private String workDayPmPeakAvgTrafficIndex;
//========================================================================
@ApiModelProperty(value = "工作日平均流量与上周比较情况", example = "提升【下降】34000辆")
private String avgFlowLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰最大小时流量与上周比较情况", example = "提升【下降】2300辆")
private String amPeakMaxHourFlowLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰最大小时流量与上周比较情况", example = "提升【下降】3100辆")
private String pmPeakMaxHourFlowLastWeekCompare;
@ApiModelProperty(value = "工作日平峰最大小时流量与上周比较情况", example = "提升【下降】1200辆")
private String fmPeakMaxHourFlowLastWeekCompare;
@ApiModelProperty(value = "周末全天平均流量与上周比较情况", example = "提升【下降】12000辆")
private String endAvgFlowLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰平均交通指数与上周比较情况", example = "增加【减少】20%")
private String amPeakAvgTrafficIndexLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰平均交通指数与上周比较情况", example = "增加【减少】25%")
private String pmPeakAvgTrafficIndexLastWeekCompare;
//================================================================================================//
private List<CrossRunStateDetailAnalysisData> dataList = new ArrayList<>();
}
@Data
class CrossRunStateDetailAnalysisData {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position =1)
private String crossName;
@ApiModelProperty(value = "本周高峰最大小时流量", example = "8900",position = 2)
private Integer thisWeekPeakMaxFlow;
@ApiModelProperty(value = "上周高峰最大小时流量", example = "8900",position =3)
private Integer lastWeekPeakMaxFlow;
@ApiModelProperty(value = "本周周末最大小时流量", example = "8900",position = 4)
private Integer thisWeekEndMaxFlow;
@ApiModelProperty(value = "上周周末最大小时流量", example = "8900",position = 5)
private Integer lastWeekEndMaxFlow;
@ApiModelProperty(value = "本周工作日早高峰交通指数", example = "4.0",position = 5)
private Integer thisWeekWorkDayAmTrafficIndex;
@ApiModelProperty(value = "上周周工作日早高峰交通指数", example = "3.5",position = 6)
private Integer lastWeekWorkDayAmTrafficIndex;
@ApiModelProperty(value = "本周工作日晚高峰交通指数", example = "3.5",position = 7)
private Integer thisWeekWorkDayPmTrafficIndex;
@ApiModelProperty(value = "上周周工作日晚高峰交通指数", example = "4.5",position = 8)
private Integer lastWeekWorkDayPmTrafficIndex;
}
\ No newline at end of file
package net.wanji.opt.controllerv2.report.design;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.controllerv2.judgeanalysis.design.response.ParentResult;
import java.util.ArrayList;
import java.util.List;
@Data
public class CrossRunStatePeakAnalysisResult extends ParentResult {
private List<CrossRunStatePeakResultResponse> content;
public List<CrossRunStatePeakResultResponse> getContent() {
return content;
}
public CrossRunStatePeakAnalysisResult setContent(List<CrossRunStatePeakResultResponse> content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class CrossRunStatePeakResultResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)")
private String crossName;
@ApiModelProperty(value = "工作日早高峰平均交通指数与上周比较情况", example = "增加【减少】10%")
private String amPeakAvgTrafficIndexLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰平均交通指数与上周比较情况", example = "增加【减少】10%")
private String pmPeakAvgTrafficIndexLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰通行能力与上周比较情况", example = "提升【下降】5%")
private String amPeakCapacityLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰通行能力与上周比较情况", example = "提升【下降】5%")
private String pmPeakCapacityLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰平均延误与上周比较情况", example = "增加【减少】11%")
private String amPeakDelayTimeLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰平均延误与上周比较情况", example = "增加【减少】11%")
private String pmPeakDelayTimeLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰最大排队与上周比较情况", example = "增加【减少】11%")
private String amPeakMaxQueueLengthLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰最大排队与上周比较情况", example = "增加【减少】11%")
private String pmPeakMaxQueueLengthLastWeekCompare;
@ApiModelProperty(value = "工作日早高峰停车次数与上周比较情况", example = "增加【减少】5%")
private String amPeakStopTimesLastWeekCompare;
@ApiModelProperty(value = "工作日晚高峰停车次数与上周比较情况", example = "增加【减少】5%")
private String pmPeakStopTimesLastWeekCompare;
@ApiModelProperty(value = "总体运行效果", example = "明显提升【略有下降】")
private String totalityRunSituation;
//================================================================================================//
@ApiModelProperty(value = "本周早高峰集中时段", example = "7:30~8:30")
private String thisWeekAmPeakTimeSpan;
@ApiModelProperty(value = "本周早高峰集中时段持续时长", example = "45分钟")
private String thisWeekAmPeakDuration;
@ApiModelProperty(value = "本周早高峰时段开始时间上周比较情况", example = "提前【延后】20分钟")
private String thisWeekAmPeakStartTimeSituation;
@ApiModelProperty(value = "本周早高峰时段结束时间上周比较情况", example = "提前【延后】20分钟")
private String thisWeekAmPeakEndTimeSituation;
@ApiModelProperty(value = "本周早高峰持续时长上周比较情况", example = "提前【延后】20分钟")
private String thisWeekAmPeakDurationSituation;
@ApiModelProperty(value = "本周早高峰集中时段", example = "7:30~8:30")
private String thisWeekPmPeakTimeSpan;
@ApiModelProperty(value = "本周早高峰集中时段持续时长", example = "45分钟")
private String thisWeekPmPeakDuration;
@ApiModelProperty(value = "本周早高峰时段开始时间上周比较情况", example = "提前【延后】20分钟")
private String thisWeekPmPeakStartTimeSituation;
@ApiModelProperty(value = "本周早高峰时段结束时间上周比较情况", example = "提前【延后】20分钟")
private String thisWeekPmPeakEndTimeSituation;
@ApiModelProperty(value = "本周早高峰持续时长上周比较情况", example = "提前【延后】20分钟")
private String thisWeekPmPeakDurationSituation;
//================================================================================================//
//峰期交通流参数对比分析
private List<CrossRunStatePeakDetailAnalysisData> dataList = new ArrayList<>();
//高峰期时段分析
private List<CrossRunStatePeakTimeSpanAnalysisData> peakList = new ArrayList<>();
}
@Data
class CrossRunStatePeakDetailAnalysisData {
@ApiModelProperty(value = "峰期名称", example = "早高峰/晚高峰",position = 0)
private String peakName;
@ApiModelProperty(value = "本周交通指数", example = "3.4",position = 1)
private Integer thisWeekTrafficIndex;
@ApiModelProperty(value = "上周交通指数", example = "3.4",position = 2)
private Integer lastWeekTrafficIndex;
@ApiModelProperty(value = "本周通行能力", example = "15900",position = 3)
private Integer thisWeekWorkCapacity;
@ApiModelProperty(value = "上周通行能力", example = "16000",position = 4)
private Integer lastWeekCapacity;
@ApiModelProperty(value = "本周平均延误(S)", example = "40",position = 5)
private Integer thisWeekWorkDelayTime;
@ApiModelProperty(value = "上周平均延误(S)", example = "40",position = 6)
private Integer lastWeekDelayTime;
@ApiModelProperty(value = "本周最大排队", example = "240",position = 7)
private Integer thisWeekMaxQueueLength;
@ApiModelProperty(value = "上周最大排队", example = "240",position = 8)
private Integer lastWeekMaxQueueLength;
@ApiModelProperty(value = "本周停车次数", example = "4",position = 9)
private Integer thisWeekStopTimes;
@ApiModelProperty(value = "上周停车次数", example = "3.5",position = 10)
private Integer lastWeekStopTimes;
}
@Data
class CrossRunStatePeakTimeSpanAnalysisData {
@ApiModelProperty(value = "星期", example = "周一",position = 0)
private String weekName;
@ApiModelProperty(value = "本周早高峰时段", example = "7:00~8:00",position = 1)
private String thisWeekAmPeakTimeSpan;
@ApiModelProperty(value = "上周早高峰时段", example = "7:00~8:00",position = 2)
private String lastWeekAmPeakTimeSpan;
@ApiModelProperty(value = "本周早高峰持续时长(min)", example = "30",position = 3)
private String thisWeekAmPeakDuration;
@ApiModelProperty(value = "上周早高峰持续时长(min)", example = "30",position = 4)
private String lastWeekAmPeakDuration;
@ApiModelProperty(value = "本周晚高峰时段", example = "7:00~8:00",position = 5)
private String thisWeekPmPeakTimeSpan;
@ApiModelProperty(value = "上周晚高峰时段", example = "7:00~8:00",position = 6)
private String lastWeekPmPeakTimeSpan;
@ApiModelProperty(value = "本周晚高峰持续时长(min)", example = "30",position = 7)
private String thisWeekPmPeakDuration;
@ApiModelProperty(value = "上周晚高峰持续时长(min)", example = "30",position = 8)
private String lastWeekPmPeakDuration;
}
package net.wanji.opt.controllerv2.report.design;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.controllerv2.judgeanalysis.design.response.ParentResult;
import java.util.ArrayList;
import java.util.List;
@Data
public class ImportCrossReportAnalysis extends ParentResult {
private List<ImportCrossAnalysisResponse> content;
public List<ImportCrossAnalysisResponse> getContent() {
return content;
}
public ImportCrossReportAnalysis setContent(List<ImportCrossAnalysisResponse> content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class ImportCrossAnalysisResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周优化集中时段分布情况", example = "7:00~8:00,12:00~13:30,17:30~18:40",position = 1)
private String optimizeSpan;
@ApiModelProperty(value = "本周溢出优化次数", example = "10次",position = 2)
private String overFlowOptimizeCount;
@ApiModelProperty(value = "本周溢出主要发生方向", example = "北出口、南出口",position = 3)
private String overFlowDirs;
@ApiModelProperty(value = "本周拥堵优化次数", example = "10次",position = 4)
private String congestOptimizeCount;
@ApiModelProperty(value = "本周拥堵主要发生方向", example = "北出口、南出口",position = 5)
private String congestDirs;
@ApiModelProperty(value = "本周空放优化次数", example = "10次",position = 6)
private String emptyPassOptimizeCount;
@ApiModelProperty(value = "本周空放主要发生方向", example = "北出口、南出口",position = 7)
private String emptyPassDirs;
@ApiModelProperty(value = "本周失衡优化次数", example = "10次",position = 8)
private String unbalanceOptimizeCount;
@ApiModelProperty(value = "本周失衡主要发生方向", example = "北出口、南出口",position = 9)
private String unbalanceDirs;
//================================================================================================//
@ApiModelProperty(value = "本周平均通行能力", example = "7800辆/小时",position = 10)
private String avgCapacity;
@ApiModelProperty(value = "平均通行能力与上周相比情况", example = "提升",position = 11)
private String avgCapacityCompareSituation;
//================================================================================================//
@ApiModelProperty(value = "本周延误时间", example = "22",position = 12)
private String delayTime;
@ApiModelProperty(value = "延误时间与上周相比情况", example = "增加【减少】10%",position = 13)
private String delayTimeCompare;
//================================================================================================//
@ApiModelProperty(value = "本周停车次数", example = "22",position = 14)
private String avgStopTimes;
@ApiModelProperty(value = "平均拥堵指数与上周相比情况", example = "增加【减少】10%",position = 15)
private String avgCongestIndexCompare;
//================================================================================================//
@ApiModelProperty(value = "本周最大排队长度", example = "203",position = 16)
private String maxQueueLength;
@ApiModelProperty(value = "本周最大排队长度与上周相比情况", example = "提升【降低】10%",position = 17)
private String maxQueueLengthCompare;
//================================================================================================//
@ApiModelProperty(value = "本周总体效果情况", example = "明显提升",position = 18)
private String weekTotalitySituation;
private List<ImportCrossReportAnalysisData> dataList = new ArrayList<>();
}
@Data
class ImportCrossReportAnalysisData {
@ApiModelProperty(value = "星期", example = "星期一", position = 0)
private String weekName;
@ApiModelProperty(value = "策略优化时段", example = "7:35~8:40", position = 1)
private String optimizeTimeSpan;
@ApiModelProperty(value = "本周优化次数与问题次数比", example = "20/100", position = 2)
private String thisWeekCountRadio;
@ApiModelProperty(value = "上周优化次数与问题次数比", example = "20/100", position = 3)
private String lastWeekCountRadio;
@ApiModelProperty(value = "本周通行能力", example = "3466", position = 4)
private Integer thisWeekCapacity;
@ApiModelProperty(value = "上周通行能力", example = "5600", position = 5)
private Integer lastWeekCapacity;
@ApiModelProperty(value = "本周停车次数", example = "20", position = 6)
private Double thisWeekStopTimes;
@ApiModelProperty(value = "上周停车次数", example = "30", position = 7)
private Double lastWeekStopTimes;
@ApiModelProperty(value = "本周延误时间", example = "30.5", position = 8)
private Double thisWeekDelayTime;
@ApiModelProperty(value = "上周延误时间", example = "30.2", position = 9)
private Double lastWeekDelayTime;
@ApiModelProperty(value = "本周最大排队长度", example = "6.5", position = 10)
private Double thisWeekMaxQueueLength;
@ApiModelProperty(value = "上周最大排队长度", example = "-1.5%", position = 11)
private Double lastWeekMaxQueueLength;
}
...@@ -122,21 +122,21 @@ public class AnalysisGreenWavePeakDetailServiceImpl extends BaseDubboInterfaceIm ...@@ -122,21 +122,21 @@ public class AnalysisGreenWavePeakDetailServiceImpl extends BaseDubboInterfaceIm
weekData.setThisWeekCongestSpan(DateUtil.formatDate(vo1.getCongestStartTime(), "HH:mm") + "~" + DateUtil.formatDate(vo2.getCongestEndTime(), "HH:mm")); weekData.setThisWeekCongestSpan(DateUtil.formatDate(vo1.getCongestStartTime(), "HH:mm") + "~" + DateUtil.formatDate(vo2.getCongestEndTime(), "HH:mm"));
} }
if (Objects.nonNull(lastWeekDataList)){ if (Objects.nonNull(lastWeekDataList)){
//上周高峰指标数据 //上周高峰指标数据
Optional<AnalysisGreenWavePeakDetail> optional = lastWeekDataList.stream().filter(o -> Objects.equals(o.getWeekDay(), detail.getWeekDay()) && Objects.equals(o.getPeakType(), detail.getPeakType())).findFirst(); Optional<AnalysisGreenWavePeakDetail> optional = lastWeekDataList.stream().filter(o -> Objects.equals(o.getWeekDay(), detail.getWeekDay()) && Objects.equals(o.getPeakType(), detail.getPeakType())).findFirst();
if (optional.isPresent()) { if (optional.isPresent()) {
weekData.setLastWeekAvgSpeed(optional.get().getSpeed()); weekData.setLastWeekAvgSpeed(optional.get().getSpeed());
weekData.setLastWeekCongestIndex(optional.get().getTrafficIndex()); weekData.setLastWeekCongestIndex(optional.get().getTrafficIndex());
weekData.setLastWeekTravelTime(optional.get().getTravelTime() == null ? 0D : ArithOfBigDecmial.div(optional.get().getTravelTime().doubleValue(), 60)); weekData.setLastWeekTravelTime(optional.get().getTravelTime() == null ? 0D : ArithOfBigDecmial.div(optional.get().getTravelTime().doubleValue(), 60));
//上周峰期内拥堵时段数据获取 //上周峰期内拥堵时段数据获取
List<GreenCongestTimeSpanVO> congestTimeSpan2 = analysisGreenWavePeakDetailMapper.findCongestTimeSpanInPeakTime(lastWeek, k, optional.get().getPeakStartTime(), optional.get().getPeakEndTime()); List<GreenCongestTimeSpanVO> congestTimeSpan2 = analysisGreenWavePeakDetailMapper.findCongestTimeSpanInPeakTime(lastWeek, k, optional.get().getPeakStartTime(), optional.get().getPeakEndTime());
GreenCongestTimeSpanVO vo3 = congestTimeSpan2.stream().min(Comparator.comparing(GreenCongestTimeSpanVO::getCongestStartTime)).orElse(new GreenCongestTimeSpanVO()); GreenCongestTimeSpanVO vo3 = congestTimeSpan2.stream().min(Comparator.comparing(GreenCongestTimeSpanVO::getCongestStartTime)).orElse(new GreenCongestTimeSpanVO());
GreenCongestTimeSpanVO vo4 = congestTimeSpan2.stream().max(Comparator.comparing(GreenCongestTimeSpanVO::getCongestEndTime)).orElse(new GreenCongestTimeSpanVO()); GreenCongestTimeSpanVO vo4 = congestTimeSpan2.stream().max(Comparator.comparing(GreenCongestTimeSpanVO::getCongestEndTime)).orElse(new GreenCongestTimeSpanVO());
if (vo3.getCongestStartTime() != null && vo4.getCongestEndTime() != null) { if (vo3.getCongestStartTime() != null && vo4.getCongestEndTime() != null) {
weekData.setLastWeekCongestSpan(DateUtil.formatDate(vo3.getCongestStartTime(), "HH:mm") + "~" + DateUtil.formatDate(vo4.getCongestEndTime(), "HH:mm")); weekData.setLastWeekCongestSpan(DateUtil.formatDate(vo3.getCongestStartTime(), "HH:mm") + "~" + DateUtil.formatDate(vo4.getCongestEndTime(), "HH:mm"));
}
weekData.setLastWeekDayPeakSpan(DateUtil.formatDate(optional.get().getPeakStartTime(), "HH:mm") + "~" + DateUtil.formatDate(optional.get().getPeakEndTime(), "HH:mm"));
} }
weekData.setLastWeekDayPeakSpan(DateUtil.formatDate(optional.get().getPeakStartTime(), "HH:mm") + "~" + DateUtil.formatDate(optional.get().getPeakEndTime(), "HH:mm"));
}
} }
tableDataList.add(weekData); tableDataList.add(weekData);
......
...@@ -48,7 +48,7 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService { ...@@ -48,7 +48,7 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService {
/** /**
* 根据区划类型查询对应集合(含子集) * 根据区划类型查询对应集合(含子集)
* @param type * @param types
* @return * @return
*/ */
public List<BaseAreaInfoPO> selectByType(String types) { public List<BaseAreaInfoPO> selectByType(String types) {
...@@ -61,7 +61,8 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService { ...@@ -61,7 +61,8 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService {
for (BaseAreaInfoPO parent : parentList) { for (BaseAreaInfoPO parent : parentList) {
List<BaseAreaInfoPO> child = baseAreaInfoMapper.selectByParentCode(parent.getId()); List<BaseAreaInfoPO> child = baseAreaInfoMapper.selectByParentCode(parent.getId());
retList.add(parent); retList.add(parent);
retList.addAll(child); //屏蔽子区输出
//retList.addAll(child);
} }
} }
......
...@@ -40,7 +40,7 @@ public class SysLogServerImpl extends ServiceImpl<SysLogMapper, SysOptimizeLog> ...@@ -40,7 +40,7 @@ public class SysLogServerImpl extends ServiceImpl<SysLogMapper, SysOptimizeLog>
if (temp1.get("command").equals(1)) { if (temp1.get("command").equals(1)) {
temp.setCommandType("步进控制"); temp.setCommandType("步进控制");
} else if (temp1.get("command").equals(0)) { } else if (temp1.get("command").equals(0)) {
temp.setCommandType("步进恢复"); temp.setCommandType("解除步进");
} }
break; break;
case "2": case "2":
...@@ -58,8 +58,26 @@ public class SysLogServerImpl extends ServiceImpl<SysLogMapper, SysOptimizeLog> ...@@ -58,8 +58,26 @@ public class SysLogServerImpl extends ServiceImpl<SysLogMapper, SysOptimizeLog>
temp.setCommandType("临时方案下发"); temp.setCommandType("临时方案下发");
break; break;
case "5": case "5":
temp.setCommandType("定时任务恢复失败"); JSONObject temp3 = JSONObject.parseObject(temp.getDataInfo());
break; Integer commandType = temp3.getInteger("commandType");
switch (commandType) {
//1-步进控制/恢复(公用);2-恢复时间表(公用);3-相位锁定/解锁(公用);4-临时方案下发(公用);5-定时任务恢复失败;10-查询环图失败记录',
case 1:
temp.setCommandType("定时任务 - 解除步进控制");
break;
case 2:
temp.setCommandType("定时任务 - 恢复时间表");
break;
case 3:
temp.setCommandType("定时任务 - 解除相位锁定");
break;
case 4:
temp.setCommandType("定时任务 - 解除临时方案下发");
break;
default:
temp.setCommandType("定时任务 - 解除控制指令");
break;
}
default: default:
temp.setCommandType("其它操作"); temp.setCommandType("其它操作");
break; break;
......
...@@ -62,8 +62,7 @@ public class OptimizeStatisticTask { ...@@ -62,8 +62,7 @@ public class OptimizeStatisticTask {
/** /**
* 干线策略优化时长计算 * 干线策略优化时长计算
*/ */
@Scheduled(cron = "0 40 1 * * ?") @Scheduled(cron = "0 40 2 ? * 1")
public void optimizeGreenWaveDurationCal() { public void optimizeGreenWaveDurationCal() {
long st = System.currentTimeMillis(); long st = System.currentTimeMillis();
try { try {
......
/**
*
*/
package zsg;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import net.wanji.opt.SignalOptimizeApplication;
import net.wanji.opt.common.EsDateIndexUtil;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemCrossDayService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author fengyi
* @date
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SignalOptimizeApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class AreaCrossTest {
@Resource
AnalysisProblemCrossDayService analysisProblemCrossDayService;
@Test
public void testProducerTrack() {
analysisProblemCrossDayService.updateCrossAreaIdByCondition();
}
}
spring:
cloud:
nacos:
config:
server-addr: 37.12.182.29:8848
file-extension: yaml
group: signal
namespace: signal
username: nacos
password: nacos
application:
# dubbo启动需要程序名称
name: signal-optimize-service
main:
allow-circular-references: true
spring:
profiles:
active: test
logging:
level:
org.apache.ibatis: DEBUG
\ No newline at end of file
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