Commit 2a705741 authored by zhoushiguang's avatar zhoushiguang

干线周报接口-路口问题分析接口设计

parent 967f0e0a
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.CrossImportProblemAnalysisResult;
import net.wanji.opt.controllerv2.report.design.CrossProblemTotalityAnalysisResult;
import net.wanji.opt.controllerv2.report.design.CrossRunStateAnalysisResult;
import net.wanji.opt.controllerv2.report.design.CrossRunStatePeakAnalysisResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 路口运行状态 接口API
* </p>
* @version 1.0
* @author
* @Date 2025-03-18
*/
@RestController
@Slf4j
@RequestMapping("/cross-problem")
@Api(value="CrossProblemController", description="", tags = "路口分析报告-周报")
public class CrossProblemController {
@ApiOperation(httpMethod="GET",value="3.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 = CrossProblemTotalityAnalysisResult.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="3.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 = "/getSeriousProblem")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossImportProblemAnalysisResult.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 CrossImportProblemAnalysisResult extends ParentResult {
private CrossImportProblemResultResponse content;
public CrossImportProblemResultResponse getContent() {
return content;
}
public CrossImportProblemAnalysisResult setContent(CrossImportProblemResultResponse content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class CrossImportProblemResultResponse {
@ApiModelProperty(value = "溢出最严重路口", example = "旅游路-洪山路交叉口、旅游路-霞景路交叉口",position = 0)
private String overFlowCrossName;
@ApiModelProperty(value = "本周溢出时长", example = "3.5小时",position = 1)
private String overFlowDuration;
@ApiModelProperty(value = "拥堵最严重路口", example = "旅游路-洪山路交叉口、旅游路-霞景路交叉口",position = 2)
private String congestCrossName;
@ApiModelProperty(value = "本周溢出时长", example = "3.5小时",position = 3)
private String congestDuration;
//================================================================================================//
@ApiModelProperty(value = "溢出路口排名,top10",position = 4)
private List<CrossImportProblemData> overFlowList=new ArrayList<>();
@ApiModelProperty(value = "拥堵路口排名,top10",position = 5)
private List<CrossImportProblemData> congestList=new ArrayList<>();
}
@Data
class CrossImportProblemData {
@ApiModelProperty(value = "数据类型:1溢出 2拥堵",example = "1",position = 0)
private String dataType ;
@ApiModelProperty(value = "路口名称",example = "旅游路-洪山路交叉口",position = 1)
private String crossName ;
@ApiModelProperty(value = "持续时长",example = "90",position = 2)
private Integer duration ;
@ApiModelProperty(value = "本周路口最严重时段",example = "7:00~7:30",position = 3)
private String seriousTimeSpan ;
@ApiModelProperty(value = "本周路口最严重时段持续时长",example = "溢出时长30分钟",position = 4)
private String seriousTimeSpanDuration ;
@ApiModelProperty(value = "工作日平均每天溢出次数",example = "3次",position = 5)
private String workDayAvgOverCount ;
@ApiModelProperty(value = "工作日平均每天溢出时长",example = "溢出时长30分钟",position = 6)
private String workDayAvgOverDuration ;
@ApiModelProperty(value = "路口每天时段详情",position = 7)
private List<CrossImportProblemDetail> list=new ArrayList<>();
}
@Data
class CrossImportProblemDetail{
@ApiModelProperty(value = "周几",example = "周一",position = 0)
private String weekName ;
@ApiModelProperty(value = "时段",example = "7:00~7:30",position = 1)
private String timeSpan ;
@ApiModelProperty(value = "时长",example = "30分钟",position = 2)
private String duration ;
}
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 CrossProblemTotalityAnalysisResult extends ParentResult {
private CrossProblemTotalityResultResponse content;
public CrossProblemTotalityResultResponse getContent() {
return content;
}
public CrossProblemTotalityAnalysisResult setContent(CrossProblemTotalityResultResponse content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class CrossProblemTotalityResultResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周溢出总次数", example = "20次",position = 1)
private String weekOverFlowCount;
@ApiModelProperty(value = "本周溢出总次数与上周比较情况", example = "增加【减少】10%",position = 2)
private String weekOverFlowCountCompare;
@ApiModelProperty(value = "本周溢出时长", example = "3.5小时",position = 3)
private String weekOverFlowDuration;
@ApiModelProperty(value = "本周溢出时长与上周比较情况", example = "增加【减少】13%",position = 4)
private String weekOverFlowDurationCompare;
@ApiModelProperty(value = "本周拥堵总次数", example = "20次",position = 5)
private String weekCongestCount;
@ApiModelProperty(value = "本周拥堵总次数与上周比较情况", example = "增加【减少】10%",position = 6)
private String weekCongestCountCompare;
@ApiModelProperty(value = "本周拥堵时长", example = "3.5小时",position = 7)
private String weekCongestDuration;
@ApiModelProperty(value = "本周拥堵时长与上周比较情况", example = "增加【减少】13%",position = 8)
private String weekCongestDurationCompare;
//================================================================================================//
private List<CrossProblemTotalityData> dataList=new ArrayList<>();
}
@Data
class CrossProblemTotalityData {
@ApiModelProperty(value = "数据类型:1次数 2时长",example = "1",position = 0)
private String dataType ;
@ApiModelProperty(value = "本周溢出数值【次数或时长】",example = "8900",position = 0)
private String thisWeekOverFlowNumber ;
@ApiModelProperty(value = "上周溢出数值【次数或时长】",example = "8900",position = 1)
private String lastWeekOverFlowNumber ;
@ApiModelProperty(value = "本周拥堵数值【次数或时长】",example = "8900",position = 2)
private String thisWeekCongestNumber ;
@ApiModelProperty(value = "上周拥堵数值【次数或时长】",example = "8900",position = 3)
private String lastWeekCongestNumber ;
@ApiModelProperty(value = "本周失衡数值【次数或时长】",example = "8900",position = 4)
private String thisWeekUnbalanceNumber ;
@ApiModelProperty(value = "上周失衡数值【次数或时长】",example = "8900",position = 5)
private String lastWeekUnbalanceNumber ;
@ApiModelProperty(value = "本周空放数值【次数或时长】",example = "8900",position = 6)
private String thisWeekEmptyPassNumber ;
@ApiModelProperty(value = "上周空放数值【次数或时长】",example = "8900",position = 7)
private String lastWeekEmptyPassNumber ;
}
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